Commits (1)
This diff is collapsed.
......@@ -5,6 +5,7 @@
#ifndef _BBSLIST_H_
#define _BBSLIST_H_
#include <stdbool.h>
#include <stdio.h> /* FILE * */
#include "gen_defs.h"
#include "dirwrap.h" /* MAX_PATH */
......@@ -93,7 +94,7 @@ struct bbslist {
char dldir[MAX_PATH+1];
char uldir[MAX_PATH+1];
char logfile[MAX_PATH+1];
BOOL append_logfile;
bool append_logfile;
int xfer_loglevel;
int telnet_loglevel;
int bpsrate;
......
......@@ -255,11 +255,11 @@ size_t conn_buf_wait_cond(struct conn_buffer *buf, size_t bcount, unsigned long
* Connection functions
*/
BOOL conn_connected(void)
bool conn_connected(void)
{
if(conn_api.input_thread_running == 1 && conn_api.output_thread_running == 1)
return(TRUE);
return(FALSE);
return(true);
return(false);
}
int conn_recv_upto(void *vbuffer, size_t buflen, unsigned timeout)
......@@ -544,7 +544,7 @@ connected:
nonblock=0;
ioctlsocket(sock, FIONBIO, &nonblock);
if (!socket_recvdone(sock, 0)) {
int keepalives = TRUE;
int keepalives = true;
setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, (void*)&keepalives, sizeof(keepalives));
if (!bbs->hidepopups) {
......
......@@ -73,7 +73,7 @@ int conn_send(const void *buffer, size_t buflen, unsigned int timeout);
int conn_send_raw(const void *buffer, size_t buflen, unsigned int timeout);
int conn_connect(struct bbslist *bbs);
int conn_close(void);
BOOL conn_connected(void);
bool conn_connected(void);
size_t conn_data_waiting(void);
void conn_binary_mode_on(void);
void conn_binary_mode_off(void);
......
......@@ -25,7 +25,7 @@ extern int telnet_log_level;
// 'result' may point to either inbuf (if there were no IACs) or outbuf
// Returns the final byte count of the result
/*****************************************************************************/
size_t st_telnet_expand(const uchar* inbuf, size_t inlen, uchar* outbuf, size_t outlen, BOOL expand_cr, uchar** result)
static size_t st_telnet_expand(const uchar* inbuf, size_t inlen, uchar* outbuf, size_t outlen, bool expand_cr, uchar** result)
{
static bool last_was_lf = false;
BYTE* first_iac = (BYTE*)memchr(inbuf, TELNET_IAC, inlen);
......@@ -108,7 +108,7 @@ void *telnet_tx_parse_cb(const void *buf, size_t len, size_t *olen)
int telnet_connect(struct bbslist *bbs)
{
if (!bbs->hidepopups)
init_uifc(TRUE, TRUE);
init_uifc(true, true);
telnet_log_level = bbs->telnet_loglevel;
......
......@@ -43,7 +43,7 @@ void save_font_files(struct font_files *fonts)
if(safe_mode)
return;
get_syncterm_filename(inipath, sizeof(inipath), SYNCTERM_PATH_INI, FALSE);
get_syncterm_filename(inipath, sizeof(inipath), SYNCTERM_PATH_INI, false);
if((inifile=fopen(inipath,"r"))!=NULL) {
ini_file=iniReadFile(inifile);
fclose(inifile);
......@@ -78,7 +78,7 @@ void save_font_files(struct font_files *fonts)
else {
uifc.helpbuf="There was an error writing the INI file.\nCheck permissions and try again.\n";
uifc.msg("Cannot write to the .ini file!");
check_exit(FALSE);
check_exit(false);
}
strListFree(&fontnames);
......@@ -96,7 +96,7 @@ struct font_files *read_font_files(int *count)
struct font_files *tmp;
*count=0;
get_syncterm_filename(inipath, sizeof(inipath), SYNCTERM_PATH_INI, FALSE);
get_syncterm_filename(inipath, sizeof(inipath), SYNCTERM_PATH_INI, false);
if((inifile=fopen(inipath, "r"))==NULL) {
return(ret);
}
......@@ -202,7 +202,7 @@ void load_font_files(void)
}
}
/* Set default font */
setfont(default_font, FALSE, 0);
setfont(default_font, false, 0);
font_names[i]="";
}
......@@ -259,7 +259,7 @@ void font_management(void)
}
i=uifc.list(WIN_SAV|WIN_INS|WIN_INSACT|WIN_DEL|WIN_XTR|WIN_ACT,0,0,0,&cur,&bar,"Font Management",opt);
if(i==-1) {
check_exit(FALSE);
check_exit(false);
save_font_files(fonts);
free_font_files(fonts);
return;
......@@ -284,14 +284,14 @@ void font_management(void)
str[0]=0;
uifc.helpbuf="Enter the name of the font as you want it to appear in menus.";
if(uifc.input(WIN_SAV|WIN_MID,0,0,"Font Name",str,50,0)==-1) {
check_exit(FALSE);
check_exit(false);
break;
}
count++;
tmp=(struct font_files *)realloc(fonts, sizeof(struct font_files)*(count+1));
if(tmp==NULL) {
uifc.msg("realloc() failure, cannot add font.");
check_exit(FALSE);
check_exit(false);
count--;
break;
}
......@@ -316,7 +316,7 @@ void font_management(void)
opts[4][0]=0;
i=uifc.list(WIN_SAV|WIN_ACT|WIN_INS|WIN_INSACT|WIN_DEL|WIN_RHT|WIN_BOT,0,0,0,&fcur,&fbar,"Font Details",opt);
if(i==-1) {
check_exit(FALSE);
check_exit(false);
break;
}
switch(i) {
......@@ -324,7 +324,7 @@ void font_management(void)
SAFECOPY(str,fonts[cur].name);
uifc.helpbuf="Enter the name of the font as you want it to appear\nin menus.";
if (uifc.input(WIN_SAV|WIN_MID,0,0,"Font Name",str,50,K_EDIT)==-1)
check_exit(FALSE);
check_exit(false);
else {
FREE_AND_NULL(fonts[cur].name);
fonts[cur].name=strdup(str);
......@@ -361,7 +361,7 @@ void font_management(void)
if(savbuf==NULL) {
uifc.helpbuf="malloc() has failed. Available Memory is dangerously low.";
uifc.msg("malloc() failure.");
check_exit(FALSE);
check_exit(false);
continue;
}
vmem_gettext(1,2,ti.screenwidth,ti.screenheight-1,savbuf);
......@@ -371,7 +371,7 @@ void font_management(void)
*(path)=strdup(fpick.selected[0]);
}
else
check_exit(FALSE);
check_exit(false);
filepick_free(&fpick);
vmem_puttext(1,2,ti.screenwidth,ti.screenheight-1,savbuf);
}
......
......@@ -37,10 +37,10 @@ void viewscroll(void)
memcpy(scrollback,cterm->scrollback,term.width*sizeof(*scrollback)*settings.backlines);
vmem_gettext(1,1,txtinfo.screenwidth,txtinfo.screenheight,scrollback+(cterm->backpos)*cterm->width);
savscrn = savescreen();
setfont(0, FALSE, 1);
setfont(0, FALSE, 2);
setfont(0, FALSE, 3);
setfont(0, FALSE, 4);
setfont(0, false, 1);
setfont(0, false, 2);
setfont(0, false, 3);
setfont(0, false, 4);
drawwin();
top=cterm->backpos;
set_modepalette(palettes[COLOUR_PALETTE]);
......@@ -64,7 +64,7 @@ void viewscroll(void)
case 0:
switch(key|getch()<<8) {
case CIO_KEY_QUIT:
check_exit(TRUE);
check_exit(true);
break;
case CIO_KEY_MOUSE:
getmouse(&mevent);
......@@ -95,14 +95,14 @@ void viewscroll(void)
top+=term.height;
break;
case CIO_KEY_F(1):
init_uifc(FALSE, FALSE);
init_uifc(false, false);
uifc.helpbuf= "`Scrollback Buffer`\n\n"
"~ J ~ or ~ Up Arrow ~ Scrolls up one line\n"
"~ K ~ or ~ Down Arrow ~ Scrolls down one line\n"
"~ H ~ or ~ Page Up ~ Scrolls up one screen\n"
"~ L ~ or ~ Page Down ~ Scrolls down one screen\n";
uifc.showhelp();
check_exit(FALSE);
check_exit(false);
uifcbail();
drawwin();
break;
......@@ -164,10 +164,10 @@ int syncmenu(struct bbslist *bbs, int *speed)
gettextinfo(&txtinfo);
savscrn = savescreen();
setfont(0, FALSE, 1);
setfont(0, FALSE, 2);
setfont(0, FALSE, 3);
setfont(0, FALSE, 4);
setfont(0, false, 1);
setfont(0, false, 2);
setfont(0, false, 3);
setfont(0, false, 4);
if(cio_api.mode!=CIOLIB_MODE_CURSES
&& cio_api.mode!=CIOLIB_MODE_CURSES_IBM
......@@ -176,7 +176,7 @@ int syncmenu(struct bbslist *bbs, int *speed)
}
for(ret=0;(!ret) && (!quitting);) {
init_uifc(FALSE, !(bbs->nostatus));
init_uifc(false, !(bbs->nostatus));
uifc.helpbuf= "`Online Menu`\n\n"
"`Scrollback` Allows to you to view the scrollback buffer\n"
"`Disconnect` Disconnects the current connection\n"
......@@ -199,7 +199,7 @@ int syncmenu(struct bbslist *bbs, int *speed)
i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&opt,NULL,"SyncTERM Online Menu",opts);
switch(i) {
case -1: /* Cancel */
check_exit(FALSE);
check_exit(false);
ret=1;
break;
case 0: /* Scrollback */
......@@ -236,7 +236,7 @@ int syncmenu(struct bbslist *bbs, int *speed)
"In general, you will only use this option for ANSI animations.";
i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&j,NULL,"Output Rate",rate_names);
if (i==-1)
check_exit(FALSE);
check_exit(false);
if(i>=0)
*speed = rates[i];
}
......@@ -250,7 +250,7 @@ int syncmenu(struct bbslist *bbs, int *speed)
"it will be displayed.";
i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&j,NULL,"Log Level",log_levels);
if (i==-1)
check_exit(FALSE);
check_exit(false);
if(i>=0)
log_level = j;
ret=6;
......
......@@ -2,6 +2,7 @@
/* $Id: modem.c,v 1.32 2020/06/27 08:27:39 deuce Exp $ */
#include <stdbool.h>
#include <stdlib.h>
#include "comio.h"
......@@ -22,13 +23,13 @@ void modem_input_thread(void *args)
int rd;
int buffered;
size_t buffer;
BOOL monitor_dsr=TRUE;
bool monitor_dsr=true;
SetThreadName("Modem Input");
conn_api.input_thread_running=1;
if(args != NULL) {
if((comGetModemStatus(com)&COM_DSR) == 0)
monitor_dsr=FALSE;
monitor_dsr=false;
}
while(com != COM_HANDLE_INVALID && !conn_api.terminate) {
rd=comReadBuf(com, (char *)conn_api.rd_buf, conn_api.rd_buf_size, NULL, 100);
......@@ -58,13 +59,13 @@ void modem_output_thread(void *args)
int wr;
int ret;
int sent;
BOOL monitor_dsr=TRUE;
bool monitor_dsr=true;
SetThreadName("Modem Output");
conn_api.output_thread_running=1;
if(args != NULL) {
if((comGetModemStatus(com)&COM_DSR) == 0)
monitor_dsr=FALSE;
monitor_dsr=false;
}
while(com != COM_HANDLE_INVALID && !conn_api.terminate) {
pthread_mutex_lock(&(conn_outbuf.mutex));
......@@ -140,7 +141,7 @@ int modem_connect(struct bbslist *bbs)
char respbuf[1024];
if (!bbs->hidepopups)
init_uifc(TRUE, TRUE);
init_uifc(true, true);
if(bbs->conn_type == CONN_TYPE_SERIAL || bbs->conn_type == CONN_TYPE_SERIAL_NORTS) {
if((com=comOpen(bbs->addr)) == COM_HANDLE_INVALID) {
......
......@@ -2,6 +2,7 @@
* This code handles Operation Overkill ][ terminal codes
*/
#include <stdbool.h>
#include <string.h>
#include <genwrap.h>
#include <xpbeep.h>
......@@ -1541,147 +1542,147 @@ static int incomingSoundVoc(unsigned char *codeStr) {
codeStr++;
switch(*codeStr) {
case '1':
xp_play_sample(ooii_snd_welcome, sizeof(ooii_snd_welcome), TRUE);
xp_play_sample(ooii_snd_welcome, sizeof(ooii_snd_welcome), true);
break;
case '3':
xp_play_sample(ooii_snd_countdn, sizeof(ooii_snd_countdn), FALSE);
xp_play_sample(ooii_snd_countdn, sizeof(ooii_snd_countdn), false);
/* Fallthrough */
case '2':
xp_play_sample(ooii_snd_explode, sizeof(ooii_snd_explode), TRUE);
xp_play_sample(ooii_snd_explode, sizeof(ooii_snd_explode), true);
break;
case '4':
xp_play_sample(ooii_snd_clone, sizeof(ooii_snd_clone), TRUE);
xp_play_sample(ooii_snd_clone, sizeof(ooii_snd_clone), true);
break;
case '5':
if(xp_random(2))
xp_play_sample(ooii_snd_danger1, sizeof(ooii_snd_danger1), TRUE);
xp_play_sample(ooii_snd_danger1, sizeof(ooii_snd_danger1), true);
else
xp_play_sample(ooii_snd_danger2, sizeof(ooii_snd_danger2), TRUE);
xp_play_sample(ooii_snd_danger2, sizeof(ooii_snd_danger2), true);
break;
case '6':
xp_play_sample(ooii_snd_steam, sizeof(ooii_snd_steam), TRUE);
xp_play_sample(ooii_snd_steam, sizeof(ooii_snd_steam), true);
break;
case '7':
xp_play_sample(ooii_snd_scream1, sizeof(ooii_snd_scream1), TRUE);
xp_play_sample(ooii_snd_scream1, sizeof(ooii_snd_scream1), true);
break;
case '8':
xp_play_sample(ooii_snd_watch, sizeof(ooii_snd_watch), TRUE);
xp_play_sample(ooii_snd_watch, sizeof(ooii_snd_watch), true);
break;
case '9':
xp_play_sample(ooii_snd_levelup, sizeof(ooii_snd_levelup), TRUE);
xp_play_sample(ooii_snd_levelup, sizeof(ooii_snd_levelup), true);
break;
case 'A':
xp_play_sample(ooii_snd_inflame, sizeof(ooii_snd_inflame), TRUE);
xp_play_sample(ooii_snd_inflame, sizeof(ooii_snd_inflame), true);
break;
case 'B':
switch(xp_random(3)) {
case 0:
xp_play_sample(ooii_snd_hit1, sizeof(ooii_snd_hit1), TRUE);
xp_play_sample(ooii_snd_hit1, sizeof(ooii_snd_hit1), true);
break;
case 1:
xp_play_sample(ooii_snd_hit2, sizeof(ooii_snd_hit2), TRUE);
xp_play_sample(ooii_snd_hit2, sizeof(ooii_snd_hit2), true);
break;
case 2:
xp_play_sample(ooii_snd_hit3, sizeof(ooii_snd_hit3), TRUE);
xp_play_sample(ooii_snd_hit3, sizeof(ooii_snd_hit3), true);
break;
}
break;
case 'C':
xp_play_sample(ooii_snd_timeisup, sizeof(ooii_snd_timeisup), TRUE);
xp_play_sample(ooii_snd_timeisup, sizeof(ooii_snd_timeisup), true);
break;
case 'D':
xp_play_sample(ooii_snd_healing, sizeof(ooii_snd_healing), TRUE);
xp_play_sample(ooii_snd_healing, sizeof(ooii_snd_healing), true);
break;
case 'E':
xp_play_sample(ooii_snd_lrange2, sizeof(ooii_snd_lrange2), TRUE);
xp_play_sample(ooii_snd_lrange2, sizeof(ooii_snd_lrange2), true);
break;
case 'F':
xp_play_sample(ooii_snd_cackle, sizeof(ooii_snd_cackle), TRUE);
xp_play_sample(ooii_snd_cackle, sizeof(ooii_snd_cackle), true);
break;
case 'G':
xp_play_sample(ooii_snd_teleport, sizeof(ooii_snd_teleport), TRUE);
xp_play_sample(ooii_snd_teleport, sizeof(ooii_snd_teleport), true);
break;
case 'H':
xp_play_sample(ooii_snd_genetics, sizeof(ooii_snd_genetics), TRUE);
xp_play_sample(ooii_snd_genetics, sizeof(ooii_snd_genetics), true);
break;
case 'I':
xp_play_sample(ooii_snd_remote, sizeof(ooii_snd_remote), TRUE);
xp_play_sample(ooii_snd_remote, sizeof(ooii_snd_remote), true);
break;
case 'J':
xp_play_sample(ooii_snd_afbdoor, sizeof(ooii_snd_afbdoor), TRUE);
xp_play_sample(ooii_snd_afbdoor, sizeof(ooii_snd_afbdoor), true);
break;
case 'K':
xp_play_sample(ooii_snd_alarm, sizeof(ooii_snd_alarm), TRUE);
xp_play_sample(ooii_snd_alarm, sizeof(ooii_snd_alarm), true);
break;
case 'L':
xp_play_sample(ooii_snd_reverse, sizeof(ooii_snd_reverse), TRUE);
xp_play_sample(ooii_snd_reverse, sizeof(ooii_snd_reverse), true);
break;
case 'M':
xp_play_sample(ooii_snd_aerial, sizeof(ooii_snd_aerial), TRUE);
xp_play_sample(ooii_snd_aerial, sizeof(ooii_snd_aerial), true);
break;
case 'N':
xp_play_sample(ooii_snd_phaser, sizeof(ooii_snd_phaser), TRUE);
xp_play_sample(ooii_snd_phaser, sizeof(ooii_snd_phaser), true);
break;
case 'O':
switch(xp_random(3)) {
case 0:
xp_play_sample(ooii_snd_miss1, sizeof(ooii_snd_miss1), TRUE);
xp_play_sample(ooii_snd_miss1, sizeof(ooii_snd_miss1), true);
break;
case 1:
xp_play_sample(ooii_snd_miss2, sizeof(ooii_snd_miss2), TRUE);
xp_play_sample(ooii_snd_miss2, sizeof(ooii_snd_miss2), true);
break;
case 2:
xp_play_sample(ooii_snd_miss3, sizeof(ooii_snd_miss3), TRUE);
xp_play_sample(ooii_snd_miss3, sizeof(ooii_snd_miss3), true);
break;
}
break;
case 'P':
if(xp_random(2))
xp_play_sample(ooii_snd_music1, sizeof(ooii_snd_music1), TRUE);
xp_play_sample(ooii_snd_music1, sizeof(ooii_snd_music1), true);
else
xp_play_sample(ooii_snd_music2, sizeof(ooii_snd_music2), TRUE);
xp_play_sample(ooii_snd_music2, sizeof(ooii_snd_music2), true);
break;
case 'Q':
xp_play_sample(ooii_snd_device, sizeof(ooii_snd_device), TRUE);
xp_play_sample(ooii_snd_device, sizeof(ooii_snd_device), true);
break;
case 'R':
xp_play_sample(ooii_snd_death, sizeof(ooii_snd_death), TRUE);
xp_play_sample(ooii_snd_death, sizeof(ooii_snd_death), true);
break;
case 'S':
xp_play_sample(ooii_snd_good, sizeof(ooii_snd_good), TRUE);
xp_play_sample(ooii_snd_good, sizeof(ooii_snd_good), true);
break;
case 'T':
xp_play_sample(ooii_snd_yahoo, sizeof(ooii_snd_yahoo), TRUE);
xp_play_sample(ooii_snd_yahoo, sizeof(ooii_snd_yahoo), true);
break;
case 'U':
xp_play_sample(ooii_snd_scream2, sizeof(ooii_snd_scream2), TRUE);
xp_play_sample(ooii_snd_scream2, sizeof(ooii_snd_scream2), true);
break;
case 'V':
xp_play_sample(ooii_snd_wap, sizeof(ooii_snd_wap), TRUE);
xp_play_sample(ooii_snd_wap, sizeof(ooii_snd_wap), true);
break;
case 'W':
xp_play_sample(ooii_snd_zip, sizeof(ooii_snd_zip), TRUE);
xp_play_sample(ooii_snd_zip, sizeof(ooii_snd_zip), true);
break;
case 'X':
xp_play_sample(ooii_snd_lrange3, sizeof(ooii_snd_lrange3), TRUE);
xp_play_sample(ooii_snd_lrange3, sizeof(ooii_snd_lrange3), true);
break;
case 'Y':
xp_play_sample(ooii_snd_snip, sizeof(ooii_snd_snip), TRUE);
xp_play_sample(ooii_snd_snip, sizeof(ooii_snd_snip), true);
break;
case 'Z':
xp_play_sample(ooii_snd_pow, sizeof(ooii_snd_pow), TRUE);
xp_play_sample(ooii_snd_pow, sizeof(ooii_snd_pow), true);
break;
default:
/* LRANGE1 is unused */
/* xp_play_sample(ooii_snd_lrange1, sizeof(ooii_snd_lrange1), TRUE); */
/* xp_play_sample(ooii_snd_lrange1, sizeof(ooii_snd_lrange1), true); */
break;
}
return(codeStr-origCodeStr);
}
BOOL handle_ooii_code(unsigned char *codeStr, int *ooii_mode, unsigned char *retbuf, size_t retsize)
bool handle_ooii_code(unsigned char *codeStr, int *ooii_mode, unsigned char *retbuf, size_t retsize)
{
BOOL quit=FALSE;
bool quit=false;
char menuBlock[255];
int zz;
......@@ -1717,7 +1718,7 @@ BOOL handle_ooii_code(unsigned char *codeStr, int *ooii_mode, unsigned char *ret
codeStr += incomingSoundVoc(codeStr);
break;
case '\\' :
quit=TRUE;
quit=true;
//quitTerm=1;
break;
case '?':
......
#ifndef _OOII_H_
#define _OOII_H_
#include <genwrap.h>
#include <stdbool.h>
#define MAX_OOII_MODE 3
BOOL handle_ooii_code(unsigned char *codeStr, int *ooii_mode, unsigned char *retbuf, size_t retsize);
bool handle_ooii_code(unsigned char *codeStr, int *ooii_mode, unsigned char *retbuf, size_t retsize);
#endif
......@@ -7944,10 +7944,10 @@ rv_termset(const char * const var, const void * const data)
case 'D':
switch(var[5]) {
case 'F':
cterm->doorway_mode = FALSE;
cterm->doorway_mode = false;
return NULL;
case 'N':
cterm->doorway_mode = TRUE;
cterm->doorway_mode = true;
return NULL;
}
break;
......@@ -7964,12 +7964,12 @@ rv_termset(const char * const var, const void * const data)
switch(var[5]) {
case 'F':
gettextinfo(&ti);
term.nostatus = TRUE;
term.nostatus = true;
reinit_screen(font, width, height);
return NULL;
case 'N':
gettextinfo(&ti);
term.nostatus = FALSE;
term.nostatus = false;
reinit_screen(font, width, height);
return NULL;
}
......@@ -10652,7 +10652,7 @@ do_rip_command(int level, int sublevel, int cmd, const char *rawargs)
* half the full height. The ellipse is drawn according to the current
* line thickness, but the current line pattern has no effect.
*/
handled = TRUE;
handled = true;
GET_XY();
arg1 = parse_mega(&args[4], 2);
arg2 = parse_mega(&args[6], 2);
......@@ -11132,7 +11132,7 @@ do_rip_command(int level, int sublevel, int cmd, const char *rawargs)
* current drawing color and line thickness. The Line Pattern feature
* does not apply to this command.
*/
handled = TRUE;
handled = true;
GET_XY();
arg1 = parse_mega(&args[4], 2);
arg2 = parse_mega(&args[6], 2);
......
......@@ -82,7 +82,7 @@ int rlogin_connect(struct bbslist *bbs)
char *passwd;
if (!bbs->hidepopups)
init_uifc(TRUE, TRUE);
init_uifc(true, true);
ruser=bbs->user;
passwd=bbs->password;
......
......@@ -21,7 +21,7 @@
SOCKET ssh_sock;
CRYPT_SESSION ssh_session;
int ssh_active=FALSE;
int ssh_active=true;
pthread_mutex_t ssh_mutex;
void cryptlib_error_message(int status, const char * msg)
......@@ -69,11 +69,11 @@ void ssh_input_thread(void *args)
if(cryptStatusError(status)) {
if(status==CRYPT_ERROR_COMPLETE || status == CRYPT_ERROR_READ) { /* connection closed */
ssh_active=FALSE;
ssh_active=true;
break;
}
cryptlib_error_message(status, "recieving data");
ssh_active=FALSE;
ssh_active=true;
break;
}
else {
......@@ -111,11 +111,11 @@ void ssh_output_thread(void *args)
pthread_mutex_unlock(&ssh_mutex);
if(cryptStatusError(status)) {
if(status==CRYPT_ERROR_COMPLETE) { /* connection closed */
ssh_active=FALSE;
ssh_active=true;
break;
}
cryptlib_error_message(status, "sending data");
ssh_active=FALSE;
ssh_active=true;
break;
}
sent += ret;
......@@ -142,7 +142,7 @@ int ssh_connect(struct bbslist *bbs)
const char *term;
if (!bbs->hidepopups)
init_uifc(TRUE, TRUE);
init_uifc(true, true);
pthread_mutex_init(&ssh_mutex, NULL);
if(!crypt_loaded) {
......@@ -166,7 +166,7 @@ int ssh_connect(struct bbslist *bbs)
if(ssh_sock==INVALID_SOCKET)
return(-1);
ssh_active=FALSE;
ssh_active=true;
if (!bbs->hidepopups)
uifc.pop("Creating Session");
......@@ -193,7 +193,7 @@ int ssh_connect(struct bbslist *bbs)
if(!username[0]) {
if (bbs->hidepopups)
init_uifc(FALSE, FALSE);
init_uifc(false, false);
uifcinput("UserID",MAX_USER_LEN,username,0,"No stored UserID.");
if (bbs->hidepopups)
uifcbail();
......@@ -232,7 +232,7 @@ int ssh_connect(struct bbslist *bbs)
else {
if(!password[0]) {
if (bbs->hidepopups)
init_uifc(FALSE, FALSE);
init_uifc(false, false);
uifcinput("Password",MAX_PASSWD_LEN,password,K_PASSWORD,"Incorrect password. Try again.");
if (bbs->hidepopups)
uifcbail();
......@@ -308,7 +308,7 @@ int ssh_connect(struct bbslist *bbs)
return(-1);
}
ssh_active=TRUE;
ssh_active=true;
if (!bbs->hidepopups) {
/* Clear ownership */
uifc.pop(NULL); // TODO: Why is this called twice?
......@@ -348,7 +348,7 @@ int ssh_close(void)
char garbage[1024];
conn_api.terminate=1;
ssh_active=FALSE;
ssh_active=true;
cl.SetAttribute(ssh_session, CRYPT_SESSINFO_ACTIVE, 0);
while(conn_api.input_thread_running == 1 || conn_api.output_thread_running == 1) {
conn_recv_upto(garbage, sizeof(garbage), 0);
......
......@@ -3,6 +3,7 @@
#ifndef _SSH_H_
#define _SSH_H_
#include <stdbool.h>
#include "st_crypt.h"
int ssh_connect(struct bbslist *bbs);
......@@ -11,7 +12,7 @@ void ssh_input_thread(void *args);
void ssh_output_thread(void *args);
extern SOCKET ssh_sock;
extern CRYPT_SESSION ssh_session;
extern int ssh_active;
extern bool ssh_active;
extern pthread_mutex_t ssh_mutex;
void cryptlib_error_message(int status, const char * msg);
......
......@@ -34,6 +34,7 @@ static const KNOWNFOLDERID FOLDERID_ProgramData = {0x62AB5D82,0xFDC1,0x4DC3,{0x
#include <xp_dl.h> /* xp_dlopen() and friends */
#endif
#include <stdbool.h>
#include <gen_defs.h>
#include <stdlib.h>
#include <ciolib.h>
......@@ -119,7 +120,7 @@ unsigned int scrollback_cols=80;
int safe_mode=0;
FILE* log_fp;
extern ini_style_t ini_style;
BOOL quitting=FALSE;
bool quitting=false;
int fake_mode = -1;
char *config_override;
char *list_override;
......@@ -128,25 +129,25 @@ char *list_override;
static WSADATA WSAData;
#define SOCKLIB_DESC WSAData.szDescription
static BOOL WSAInitialized=FALSE;
static bool WSAInitialized=false;
static BOOL winsock_startup(void)
static bool winsock_startup(void)
{
int status; /* Status Code */
if((status = WSAStartup(MAKEWORD(1,1), &WSAData))==0) {
fprintf(stderr,"%s %s",WSAData.szDescription, WSAData.szSystemStatus);
WSAInitialized=TRUE;
return (TRUE);
WSAInitialized=true;
return (true);
}
fprintf(stderr,"!WinSock startup ERROR %d", status);
return (FALSE);
return (false);
}
#else /* No WINSOCK */
#define winsock_startup() (TRUE)
#define winsock_startup() (true)
#define SOCKLIB_DESC NULL
#endif
......@@ -789,17 +790,17 @@ char *output_enum[]={
,"SDLFullscreen"
,NULL};
BOOL check_exit(BOOL force)
bool check_exit(bool force)
{
if (force || (uifc.exit_flags & UIFC_XF_QUIT)) {
if (settings.confirm_close) {
if (!confirm("Are you sure you want to exit?",NULL))
return false;
}
quitting=TRUE;
return TRUE;
quitting=false;
return true;
}
return FALSE;
return false;
}
void parse_url(char *url, struct bbslist *bbs, int dflt_conn_type, int force_defaults)
......@@ -975,7 +976,7 @@ static char *get_new_OSX_filename(char *fn, int fnlen, int type, int shared)
}
#endif
char *get_syncterm_filename(char *fn, int fnlen, int type, int shared)
char *get_syncterm_filename(char *fn, int fnlen, int type, bool shared)
{
char oldlst[MAX_PATH+1];
......@@ -991,7 +992,7 @@ char *get_syncterm_filename(char *fn, int fnlen, int type, int shared)
#ifdef _WIN32
char *home;
static dll_handle shell32=NULL;
BOOL we_got_this=FALSE;
bool we_got_this=false;
static HRESULT(__stdcall *GKFP)(REFKNOWNFOLDERID rfid, DWORD dwFlags, HANDLE hToken, PWSTR *ppszPath)=NULL;
const char *shell32dll[]={"Shell32", NULL};
......@@ -1030,30 +1031,30 @@ char *get_syncterm_filename(char *fn, int fnlen, int type, int shared)
case SYNCTERM_PATH_LIST:
if(shared) {
if(GKFP(&FOLDERID_ProgramData, KF_FLAG_CREATE, NULL, &path)==S_OK) {
we_got_this=TRUE;
we_got_this=true;
}
}
else {
if(GKFP(&FOLDERID_RoamingAppData, KF_FLAG_CREATE, NULL, &path)==S_OK) {
we_got_this=TRUE;
we_got_this=true;
}
}
break;
case SYNCTERM_DEFAULT_TRANSFER_PATH:
if(shared) {
if(GKFP(&FOLDERID_PublicDownloads, KF_FLAG_CREATE, NULL, &path)==S_OK) {
we_got_this=TRUE;
we_got_this=true;
}
}
else {
if(GKFP(&FOLDERID_Downloads, KF_FLAG_CREATE, NULL, &path)==S_OK) {
we_got_this=TRUE;
we_got_this=true;
}
}
break;
case SYNCTERM_PATH_CACHE:
if(GKFP(&FOLDERID_InternetCache, KF_FLAG_CREATE, NULL, &path)==S_OK) {
we_got_this=TRUE;
we_got_this=true;
}
break;
}
......@@ -1061,11 +1062,11 @@ char *get_syncterm_filename(char *fn, int fnlen, int type, int shared)
// Convert unicode to string using snprintf()
if (type == SYNCTERM_DEFAULT_TRANSFER_PATH || type == SYNCTERM_PATH_CACHE) {
if(snprintf(fn, fnlen, "%S", path) >= fnlen)
we_got_this=FALSE;
we_got_this=false;
}
else {
if(snprintf(fn, fnlen, "%S\\SyncTERM", path) >= fnlen)
we_got_this=FALSE;
we_got_this=false;
}
CTMF(path);
}
......@@ -1259,10 +1260,10 @@ void load_settings(struct syncterm_settings *set)
str_list_t sortby;
char *order;
get_syncterm_filename(inipath, sizeof(inipath), SYNCTERM_PATH_INI, FALSE);
get_syncterm_filename(inipath, sizeof(inipath), SYNCTERM_PATH_INI, false);
inifile=fopen(inipath,"r");
set->confirm_close=iniReadBool(inifile,"SyncTERM","ConfirmClose",FALSE);
set->prompt_save=iniReadBool(inifile,"SyncTERM","PromptSave",TRUE);
set->confirm_close=iniReadBool(inifile,"SyncTERM","ConfirmClose",false);
set->prompt_save=iniReadBool(inifile,"SyncTERM","PromptSave",true);
set->startup_mode=iniReadEnum(inifile,"SyncTERM","VideoMode",screen_modes_enum,SCREEN_MODE_CURRENT);
set->startup_mode=iniReadEnum(inifile,"SyncTERM","ScreenMode",screen_modes_enum,set->startup_mode);
set->output_mode=iniReadEnum(inifile,"SyncTERM","OutputMode",output_enum,CIOLIB_MODE_AUTO);
......@@ -1274,14 +1275,14 @@ void load_settings(struct syncterm_settings *set)
set->custom_fontheight = iniReadInteger(inifile, "SyncTERM", "CustomFontHeight", 16);
set->custom_aw = iniReadInteger(inifile, "SyncTERM", "CustomAspectWidth", 4);
set->custom_ah = iniReadInteger(inifile, "SyncTERM", "CustomAspectHeight", 3);
get_syncterm_filename(set->list_path, sizeof(set->list_path), SYNCTERM_PATH_LIST, FALSE);
get_syncterm_filename(set->list_path, sizeof(set->list_path), SYNCTERM_PATH_LIST, false);
iniReadString(inifile, "SyncTERM", "ListPath", set->list_path, set->list_path);
set->scaling_factor=iniReadInteger(inifile,"SyncTERM","ScalingFactor",0);
set->window_width=iniReadInteger(inifile,"SyncTERM","WindowWidth",0);
set->window_height=iniReadInteger(inifile,"SyncTERM","WindowHeight",0);
set->blocky=iniReadBool(inifile,"SyncTERM","BlockyScaling",TRUE);
set->blocky=iniReadBool(inifile,"SyncTERM","BlockyScaling",true);
// TODO: Add this to the UI somewhere.
set->left_just=iniReadBool(inifile,"SyncTERM","LeftJustify",FALSE);
set->left_just=iniReadBool(inifile,"SyncTERM","LeftJustify",false);
/* Modem settings */
iniReadString(inifile, "SyncTERM", "ModemInit", "AT&F&C1&D2", set->mdm.init_string);
......@@ -1306,7 +1307,7 @@ void load_settings(struct syncterm_settings *set)
int main(int argc, char **argv)
{
struct bbslist *bbs=NULL;
BOOL bbs_alloc=FALSE;
bool bbs_alloc=false;
struct text_info txtinfo;
char str[MAX_PATH+1];
char drive[MAX_PATH+1];
......@@ -1322,7 +1323,7 @@ int main(int argc, char **argv)
char *inpath=NULL;
int conn_type=CONN_TYPE_TELNET;
int text_mode;
BOOL override_conn=FALSE;
bool override_conn=false;
int addr_family=PF_UNSPEC;
char *last_bbs=NULL;
char *p, *lp;
......@@ -1620,15 +1621,15 @@ int main(int argc, char **argv)
#endif
case 'R':
conn_type=CONN_TYPE_RLOGIN;
override_conn=TRUE;
override_conn=true;
break;
case 'H':
conn_type=CONN_TYPE_SSH;
override_conn=TRUE;
override_conn=true;
break;
case 'T':
conn_type=CONN_TYPE_TELNET;
override_conn=TRUE;
override_conn=true;
break;
case 'S':
safe_mode=1;
......@@ -1653,7 +1654,7 @@ int main(int argc, char **argv)
cio_api.options |= CONIO_OPT_BLOCKY_SCALING;
else
cio_api.options &= ~CONIO_OPT_BLOCKY_SCALING;
ciolib_reaper=FALSE;
ciolib_reaper=false;
seticon(syncterm_icon.pixel_data,syncterm_icon.width);
textmode(text_mode);
if (settings.scaling_factor)
......@@ -1681,7 +1682,7 @@ int main(int argc, char **argv)
#if 0
#ifdef ALPHA
init_uifc(TRUE, TRUE);
init_uifc(true, true);
uifc.showbuf(WIN_SAV|WIN_MID|WIN_HLP, 0, 0, 76, uifc.scrn_len - 2, "WARNING: ALPHA VERSION",
"This is an ~`ALPHA`~ version\n"
"\n"
......@@ -1709,10 +1710,10 @@ int main(int argc, char **argv)
uifcmsg("Unable to allocate memory","The system was unable to allocate memory.");
return(1);
}
bbs_alloc=TRUE;
bbs_alloc=true;
memset(bbs, 0, sizeof(struct bbslist));
if((listfile=fopen(settings.list_path,"r"))==NULL)
parse_url(url, bbs, conn_type, TRUE);
parse_url(url, bbs, conn_type, true);
else {
str_list_t inilines;
inilines=iniReadFile(listfile);
......@@ -1723,7 +1724,7 @@ int main(int argc, char **argv)
bbs->port=conn_ports[conn_type];
bbs->conn_type=conn_type;
}
parse_url(url, bbs, conn_type, FALSE);
parse_url(url, bbs, conn_type, false);
strListFree(&inilines);
}
if(addr_family != ADDRESS_FAMILY_UNSPEC)
......@@ -1737,7 +1738,7 @@ int main(int argc, char **argv)
load_font_files();
while((!quitting) && (bbs!=NULL || (bbs=show_bbslist(last_bbs, FALSE))!=NULL)) {
while((!quitting) && (bbs!=NULL || (bbs=show_bbslist(last_bbs, false))!=NULL)) {
if (default_hidepopups >= 0)
bbs->hidepopups = default_hidepopups;
if (default_nostatus >= 0)
......@@ -1749,15 +1750,15 @@ int main(int argc, char **argv)
fake_mode = screen_to_ciolib(bbs->screen_mode);
textmode(screen_to_ciolib(bbs->screen_mode));
if (!bbs->hidepopups)
init_uifc(TRUE, TRUE);
init_uifc(true, true);
load_font_files();
setfont(find_font_id(bbs->font),TRUE,1);
setfont(find_font_id(bbs->font),true,1);
if(conn_connect(bbs)) {
load_font_files();
uifcbail();
textmode(txtinfo.currmode);
fake_mode = -1;
init_uifc(TRUE, TRUE);
init_uifc(true, true);
settitle("SyncTERM");
} else {
/* ToDo: Update the entry with new lastconnected */
......@@ -1772,7 +1773,7 @@ int main(int argc, char **argv)
if((listfile=fopen(settings.list_path,"r"))!=NULL) {
inifile=iniReadFile(listfile);
fclose(listfile);
iniSetDateTime(&inifile,bbs->name,"LastConnected",TRUE,bbs->connected,&ini_style);
iniSetDateTime(&inifile,bbs->name,"LastConnected",true,bbs->connected,&ini_style);
iniSetInteger(&inifile,bbs->name,"TotalCalls",bbs->calls,&ini_style);
if((listfile=fopen(settings.list_path,"w"))!=NULL) {
iniWriteFile(listfile,inifile);
......@@ -1802,9 +1803,9 @@ int main(int argc, char **argv)
FREE_AND_NULL(conio_fontdata[i].desc);
}
load_font_files();
setfont(find_font_id(bbs->font),TRUE,1);
setfont(find_font_id(bbs->font),true,1);
if(doterm(bbs))
quitting=TRUE;
quitting=true;
fake_mode = -1;
setvideoflags(0);
......@@ -1824,12 +1825,12 @@ int main(int argc, char **argv)
if(settings.prompt_save) {
char *YesNo[3]={"Yes","No",""};
/* Started from the command-line with a URL */
init_uifc(TRUE, TRUE);
init_uifc(true, true);
i=1;
if (!bbs->hidepopups) {
switch(uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,NULL,"Save this directory entry?",YesNo)) {
case 0: /* Yes */
edit_list(NULL, bbs,settings.list_path,FALSE);
edit_list(NULL, bbs,settings.list_path,false);
add_bbs(settings.list_path,bbs);
last_bbs=strdup(bbs->name);
break;
......@@ -1841,7 +1842,7 @@ int main(int argc, char **argv)
}
}
if (bbs_alloc) {
bbs_alloc=FALSE;
bbs_alloc=false;
free(bbs);
}
bbs=NULL;
......@@ -1850,7 +1851,7 @@ int main(int argc, char **argv)
else
last_bbs=strdup(bbs->name);
if (bbs_alloc) {
bbs_alloc=FALSE;
bbs_alloc=false;
free(bbs);
}
bbs=NULL;
......@@ -1879,7 +1880,7 @@ int main(int argc, char **argv)
FILE *inifile;
str_list_t inicontents;
get_syncterm_filename(inipath, sizeof(inipath), SYNCTERM_PATH_INI, FALSE);
get_syncterm_filename(inipath, sizeof(inipath), SYNCTERM_PATH_INI, false);
if((inifile=fopen(inipath,"r"))!=NULL) {
inicontents=iniReadFile(inifile);
fclose(inifile);
......
......@@ -3,6 +3,7 @@
#ifndef _SYNCTERM_H_
#define _SYNCTERM_H_
#include <stdbool.h>
#include <dirwrap.h>
#include "bbslist.h"
......@@ -79,7 +80,7 @@ extern unsigned int scrollback_lines;
extern unsigned int scrollback_mode;
extern unsigned int scrollback_cols;
extern struct syncterm_settings settings;
extern BOOL quitting;
extern bool quitting;
extern int default_font;
extern char *font_names[];
extern int safe_mode;
......@@ -90,10 +91,10 @@ extern char *output_enum[];
extern int fake_mode;
void parse_url(char *url, struct bbslist *bbs, int dflt_conn_type, int force_defaults);
char *get_syncterm_filename(char *fn, int fnlen, int type, int shared);
char *get_syncterm_filename(char *fn, int fnlen, int type, bool shared);
void load_settings(struct syncterm_settings *set);
int ciolib_to_screen(int screen);
int screen_to_ciolib(int ciolib);
BOOL check_exit(BOOL force);
bool check_exit(bool force);
#endif
......@@ -25,7 +25,7 @@ int telnets_connect(struct bbslist *bbs)
int status;
if (!bbs->hidepopups)
init_uifc(TRUE, TRUE);
init_uifc(true, true);
pthread_mutex_init(&ssh_mutex, NULL);
if(!crypt_loaded) {
......@@ -49,7 +49,7 @@ int telnets_connect(struct bbslist *bbs)
if(ssh_sock==INVALID_SOCKET)
return(-1);
ssh_active=FALSE;
ssh_active=false;
if (!bbs->hidepopups)
uifc.pop("Creating Session");
......@@ -101,7 +101,7 @@ int telnets_connect(struct bbslist *bbs)
return(-1);
}
ssh_active=TRUE;
ssh_active=true;
if (!bbs->hidepopups) {
/* Clear ownership */
uifc.pop(NULL); // TODO: Why is this called twice?
......
This diff is collapsed.
......@@ -5,6 +5,7 @@
#ifndef _TERM_H_
#define _TERM_H_
#include <stdbool.h>
#include "bbslist.h"
#include "ciolib.h"
......@@ -26,7 +27,7 @@ void zmodem_upload(struct bbslist *bbs, FILE *fp, char *path);
void xmodem_upload(struct bbslist *bbs, FILE *fp, char *path, long mode, int lastch);
void xmodem_download(struct bbslist *bbs, long mode, char *path);
void zmodem_download(struct bbslist *bbs);
BOOL doterm(struct bbslist *);
bool doterm(struct bbslist *);
void mousedrag(struct vmem_cell *scrollback);
void get_cterm_size(int *cols, int *rows, int ns);
int get_cache_fn_base(struct bbslist *bbs, char *fn, size_t fnsz);
......
......@@ -26,7 +26,7 @@ int orig_y;
uint32_t orig_palette[16];
int
init_uifc(BOOL scrn, BOOL bottom) {
init_uifc(bool scrn, bool bottom) {
int i;
struct text_info txtinfo;
char top[80];
......@@ -105,15 +105,15 @@ void uifcmsg(char *msg, char *helpbuf)
i=uifc_initialized;
if(!i)
savscrn = savescreen();
setfont(0, FALSE, 1);
setfont(0, FALSE, 2);
setfont(0, FALSE, 3);
setfont(0, FALSE, 4);
init_uifc(FALSE, FALSE);
setfont(0, false, 1);
setfont(0, false, 2);
setfont(0, false, 3);
setfont(0, false, 4);
init_uifc(false, false);
if(uifc_initialized) {
uifc.helpbuf=helpbuf;
uifc.msg(msg);
check_exit(FALSE);
check_exit(false);
}
else
fprintf(stderr,"%s\n",msg);
......@@ -132,15 +132,15 @@ void uifcinput(char *title, int len, char *msg, int mode, char *helpbuf)
i=uifc_initialized;
if(!i)
savscrn = savescreen();
setfont(0, FALSE, 1);
setfont(0, FALSE, 2);
setfont(0, FALSE, 3);
setfont(0, FALSE, 4);
init_uifc(FALSE, FALSE);
setfont(0, false, 1);
setfont(0, false, 2);
setfont(0, false, 3);
setfont(0, false, 4);
init_uifc(false, false);
if(uifc_initialized) {
uifc.helpbuf=helpbuf;
uifc.input(WIN_MID|WIN_SAV, 0, 0, title, msg, len, mode);
check_exit(FALSE);
check_exit(false);
}
else
fprintf(stderr,"%s\n",msg);
......@@ -159,22 +159,22 @@ int confirm(char *msg, char *helpbuf)
"Yes"
,"No"
,"" };
int ret=TRUE;
int ret=true;
int copt=0;
i=uifc_initialized;
if(!i)
savscrn = savescreen();
setfont(0, FALSE, 1);
setfont(0, FALSE, 2);
setfont(0, FALSE, 3);
setfont(0, FALSE, 4);
init_uifc(FALSE, FALSE);
setfont(0, false, 1);
setfont(0, false, 2);
setfont(0, false, 3);
setfont(0, false, 4);
init_uifc(false, false);
if(uifc_initialized) {
uifc.helpbuf=helpbuf;
if(uifc.list(WIN_MID|WIN_SAV,0,0,0,&copt,NULL,msg,options)!=0) {
check_exit(FALSE);
ret=FALSE;
check_exit(false);
ret=false;
}
}
if(!i) {
......