Skip to content
Snippets Groups Projects
Commit 4dd81bb1 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

And put two newlines (ie: one blank line) before a function

parent 1b1c3e6a
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #3507 passed
Showing
with 4583 additions and 4287 deletions
This diff is collapsed.
...@@ -48,12 +48,12 @@ ...@@ -48,12 +48,12 @@
struct conn_api conn_api; struct conn_api conn_api;
char *conn_types_enum[] = { char *conn_types_enum[] = {
"Unknown", "RLogin", "RLoginReversed", "Telnet", "Raw", "SSH", "SSHNA", "Modem", "Serial", "NoRTS", "Shell", "Unknown", "RLogin", "RLoginReversed", "Telnet", "Raw", "SSH", "SSHNA", "Modem", "Serial", "NoRTS", "Shell"
"MBBSGhost", "TelnetS", NULL , "MBBSGhost", "TelnetS", NULL
}; };
char *conn_types[] = { char *conn_types[] = {
"Unknown", "RLogin", "RLogin Reversed", "Telnet", "Raw", "SSH", "SSH (no auth)", "Modem", "Serial", "Unknown", "RLogin", "RLogin Reversed", "Telnet", "Raw", "SSH", "SSH (no auth)", "Modem", "Serial"
"3-wire (No RTS)", "Shell", "MBBS GHost", "TelnetS", NULL , "3-wire (No RTS)", "Shell", "MBBS GHost", "TelnetS", NULL
}; };
short unsigned int conn_ports[] = {0, 513, 513, 23, 0, 22, 22, 0, 0, 0, 65535, 992, 0}; short unsigned int conn_ports[] = {0, 513, 513, 23, 0, 22, 22, 0, 0, 0, 65535, 992, 0};
...@@ -62,6 +62,7 @@ struct conn_buffer conn_outbuf; ...@@ -62,6 +62,7 @@ struct conn_buffer conn_outbuf;
/* Buffer functions */ /* Buffer functions */
struct conn_buffer* struct conn_buffer*
create_conn_buf(struct conn_buffer*buf, size_t size) create_conn_buf(struct conn_buffer*buf, size_t size)
{ {
buf->buf = (unsigned char*)malloc(size); buf->buf = (unsigned char*)malloc(size);
...@@ -88,6 +89,7 @@ create_conn_buf(struct conn_buffer*buf, size_t size) ...@@ -88,6 +89,7 @@ create_conn_buf(struct conn_buffer*buf, size_t size)
} }
return buf; return buf;
} }
void void
destroy_conn_buf(struct conn_buffer*buf) destroy_conn_buf(struct conn_buffer*buf)
{ {
...@@ -95,11 +97,13 @@ destroy_conn_buf(struct conn_buffer*buf) ...@@ -95,11 +97,13 @@ destroy_conn_buf(struct conn_buffer*buf)
FREE_AND_NULL(buf->buf); FREE_AND_NULL(buf->buf);
while (pthread_mutex_destroy(&(buf->mutex))) while (pthread_mutex_destroy(&(buf->mutex)))
; ;
while (sem_destroy(&(buf->in_sem))); while (sem_destroy(&(buf->in_sem)))
;
while (sem_destroy(&(buf->out_sem))) while (sem_destroy(&(buf->out_sem)))
; ;
} }
} }
/* /*
* The mutex should always be locked by the caller * The mutex should always be locked by the caller
* for the rest of the buffer functions * for the rest of the buffer functions
...@@ -114,11 +118,13 @@ conn_buf_bytes(struct conn_buffer*buf) ...@@ -114,11 +118,13 @@ conn_buf_bytes(struct conn_buffer*buf)
return buf->buftop - buf->bufbot; return buf->buftop - buf->bufbot;
return buf->bufsize - buf->bufbot + buf->buftop; return buf->bufsize - buf->bufbot + buf->buftop;
} }
size_t size_t
conn_buf_free(struct conn_buffer*buf) conn_buf_free(struct conn_buffer*buf)
{ {
return buf->bufsize - conn_buf_bytes(buf); return buf->bufsize - conn_buf_bytes(buf);
} }
/* /*
* Copies up to outlen bytes from the buffer into outbuf, * Copies up to outlen bytes from the buffer into outbuf,
* leaving them in the buffer. Returns the number of bytes * leaving them in the buffer. Returns the number of bytes
...@@ -145,6 +151,7 @@ conn_buf_peek(struct conn_buffer*buf, void*voutbuf, size_t outlen) ...@@ -145,6 +151,7 @@ conn_buf_peek(struct conn_buffer*buf, void*voutbuf, size_t outlen)
return copy_bytes; return copy_bytes;
} }
/* /*
* Copies up to outlen bytes from the buffer into outbuf, * Copies up to outlen bytes from the buffer into outbuf,
* removing them from the buffer. Returns the number of * removing them from the buffer. Returns the number of
...@@ -169,6 +176,7 @@ conn_buf_get(struct conn_buffer*buf, void*voutbuf, size_t outlen) ...@@ -169,6 +176,7 @@ conn_buf_get(struct conn_buffer*buf, void*voutbuf, size_t outlen)
} }
return ret; return ret;
} }
/* /*
* Places up to outlen bytes from outbuf into the buffer * Places up to outlen bytes from outbuf into the buffer
* returns the number of bytes written into the buffer * returns the number of bytes written into the buffer
...@@ -199,6 +207,7 @@ conn_buf_put(struct conn_buffer*buf, const void*voutbuf, size_t outlen) ...@@ -199,6 +207,7 @@ conn_buf_put(struct conn_buffer*buf, const void*voutbuf, size_t outlen)
} }
return write_bytes; return write_bytes;
} }
/* /*
* Waits up to timeout milliseconds for bcount bytes to be available/free * Waits up to timeout milliseconds for bcount bytes to be available/free
* in the buffer. * in the buffer.
...@@ -261,6 +270,7 @@ conn_buf_wait_cond(struct conn_buffer*buf, size_t bcount, unsigned long timeout, ...@@ -261,6 +270,7 @@ conn_buf_wait_cond(struct conn_buffer*buf, size_t bcount, unsigned long timeout,
pthread_mutex_unlock(&(buf->mutex)); pthread_mutex_unlock(&(buf->mutex));
} }
} }
/* /*
* Connection functions * Connection functions
*/ */
...@@ -271,6 +281,7 @@ conn_connected(void) ...@@ -271,6 +281,7 @@ conn_connected(void)
return true; return true;
return false; return false;
} }
int int
conn_recv_upto(void*vbuffer, size_t buflen, unsigned timeout) conn_recv_upto(void*vbuffer, size_t buflen, unsigned timeout)
{ {
...@@ -304,6 +315,7 @@ conn_recv_upto(void*vbuffer, size_t buflen, unsigned timeout) ...@@ -304,6 +315,7 @@ conn_recv_upto(void*vbuffer, size_t buflen, unsigned timeout)
return found; return found;
} }
int int
conn_send_raw(const void*vbuffer, size_t buflen, unsigned int timeout) conn_send_raw(const void*vbuffer, size_t buflen, unsigned int timeout)
{ {
...@@ -317,6 +329,7 @@ conn_send_raw(const void*vbuffer, size_t buflen, unsigned int timeout) ...@@ -317,6 +329,7 @@ conn_send_raw(const void*vbuffer, size_t buflen, unsigned int timeout)
pthread_mutex_unlock(&(conn_outbuf.mutex)); pthread_mutex_unlock(&(conn_outbuf.mutex));
return found; return found;
} }
int int
conn_send(const void*vbuffer, size_t buflen, unsigned int timeout) conn_send(const void*vbuffer, size_t buflen, unsigned int timeout)
{ {
...@@ -344,6 +357,7 @@ conn_send(const void*vbuffer, size_t buflen, unsigned int timeout) ...@@ -344,6 +357,7 @@ conn_send(const void*vbuffer, size_t buflen, unsigned int timeout)
return found; return found;
} }
int int
conn_connect(struct bbslist*bbs) conn_connect(struct bbslist*bbs)
{ {
...@@ -422,6 +436,7 @@ conn_connect(struct bbslist*bbs) ...@@ -422,6 +436,7 @@ conn_connect(struct bbslist*bbs)
} }
return conn_api.terminate; return conn_api.terminate;
} }
size_t size_t
conn_data_waiting(void) conn_data_waiting(void)
{ {
...@@ -432,6 +447,7 @@ conn_data_waiting(void) ...@@ -432,6 +447,7 @@ conn_data_waiting(void)
pthread_mutex_unlock(&(conn_inbuf.mutex)); pthread_mutex_unlock(&(conn_inbuf.mutex));
return found; return found;
} }
int int
conn_close(void) conn_close(void)
{ {
...@@ -453,6 +469,7 @@ enum failure_reason { ...@@ -453,6 +469,7 @@ enum failure_reason {
, ,
FAILURE_DISCONNECTED FAILURE_DISCONNECTED
}; };
int int
conn_socket_connect(struct bbslist*bbs) conn_socket_connect(struct bbslist*bbs)
{ {
...@@ -613,6 +630,7 @@ connected: ...@@ -613,6 +630,7 @@ connected:
closesocket(sock); closesocket(sock);
return INVALID_SOCKET; return INVALID_SOCKET;
} }
void void
conn_binary_mode_on(void) conn_binary_mode_on(void)
{ {
...@@ -620,6 +638,7 @@ conn_binary_mode_on(void) ...@@ -620,6 +638,7 @@ conn_binary_mode_on(void)
conn_api.binary_mode_on(); conn_api.binary_mode_on();
conn_api.binary_mode = true; conn_api.binary_mode = true;
} }
void void
conn_binary_mode_off(void) conn_binary_mode_off(void)
{ {
......
...@@ -145,6 +145,7 @@ static cc_t ttydefchars[NCCS] = { ...@@ -145,6 +145,7 @@ static cc_t ttydefchars[NCCS] = {
extern int default_font; extern int default_font;
#ifdef NEEDS_CFMAKERAW #ifdef NEEDS_CFMAKERAW
void void
cfmakeraw(struct termios*t) cfmakeraw(struct termios*t)
{ {
...@@ -158,6 +159,7 @@ cfmakeraw(struct termios*t) ...@@ -158,6 +159,7 @@ cfmakeraw(struct termios*t)
#endif #endif
#ifdef NEEDS_FORKPTY #ifdef NEEDS_FORKPTY
static int static int
login_tty(int fd) login_tty(int fd)
{ {
...@@ -173,6 +175,7 @@ login_tty(int fd) ...@@ -173,6 +175,7 @@ login_tty(int fd)
} }
#ifdef NEEDS_DAEMON #ifdef NEEDS_DAEMON
/* /*
* ************************************************************************** * **************************************************************************
* Daemonizes the process * Daemonizes the process
...@@ -209,6 +212,7 @@ daemon(int nochdir, int noclose) ...@@ -209,6 +212,7 @@ daemon(int nochdir, int noclose)
} }
#endif /* ifdef NEEDS_DAEMON */ #endif /* ifdef NEEDS_DAEMON */
static int static int
openpty(int*amaster, int*aslave, char*name, struct termios*termp, struct winsize*winp) openpty(int*amaster, int*aslave, char*name, struct termios*termp, struct winsize*winp)
{ {
...@@ -258,6 +262,7 @@ openpty(int*amaster, int*aslave, char*name, struct termios*termp, struct winsize ...@@ -258,6 +262,7 @@ openpty(int*amaster, int*aslave, char*name, struct termios*termp, struct winsize
errno = ENOENT; /* out of ptys */ errno = ENOENT; /* out of ptys */
return -1; return -1;
} }
static int static int
forkpty(int*amaster, char*name, struct termios*termp, struct winsize*winp) forkpty(int*amaster, char*name, struct termios*termp, struct winsize*winp)
{ {
...@@ -294,6 +299,7 @@ static int status; ...@@ -294,6 +299,7 @@ static int status;
#ifdef __BORLANDC__ #ifdef __BORLANDC__
#pragma argsused #pragma argsused
#endif #endif
void void
pty_input_thread(void*args) pty_input_thread(void*args)
{ {
...@@ -344,6 +350,7 @@ pty_input_thread(void*args) ...@@ -344,6 +350,7 @@ pty_input_thread(void*args)
#ifdef __BORLANDC__ #ifdef __BORLANDC__
#pragma argsused #pragma argsused
#endif #endif
void void
pty_output_thread(void*args) pty_output_thread(void*args)
{ {
...@@ -399,6 +406,7 @@ pty_output_thread(void*args) ...@@ -399,6 +406,7 @@ pty_output_thread(void*args)
} }
conn_api.output_thread_running = 2; conn_api.output_thread_running = 2;
} }
int int
pty_connect(struct bbslist*bbs) pty_connect(struct bbslist*bbs)
{ {
...@@ -451,7 +459,8 @@ pty_connect(struct bbslist*bbs) ...@@ -451,7 +459,8 @@ pty_connect(struct bbslist*bbs)
":sc=\\E[s:se=\\E[m:sf=\\E[S:so=\\E[0;1;7m:sr=\\E[T:st=\\E[H" ":sc=\\E[s:se=\\E[m:sf=\\E[S:so=\\E[0;1;7m:sr=\\E[T:st=\\E[H"
":ta=^I:up=\\E[A:ve=\\E[?25h:vi=\\E[?25l:vs=\\E[?25h:" ":ta=^I:up=\\E[A:ve=\\E[?25h:vi=\\E[?25l:vs=\\E[?25h:"
, ,
ws.ws_col, ws.ws_col
,
ws.ws_row ws.ws_row
, ,
cio_api.options cio_api.options
...@@ -500,6 +509,7 @@ pty_connect(struct bbslist*bbs) ...@@ -500,6 +509,7 @@ pty_connect(struct bbslist*bbs)
return 0; return 0;
} }
int int
pty_close(void) pty_close(void)
{ {
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include "syncterm.h" #include "syncterm.h"
#include "uifc.h" #include "uifc.h"
#include "uifcinit.h" #include "uifcinit.h"
void void
free_font_files(struct font_files*ff) free_font_files(struct font_files*ff)
{ {
...@@ -27,6 +28,7 @@ free_font_files(struct font_files*ff) ...@@ -27,6 +28,7 @@ free_font_files(struct font_files*ff)
} }
free(ff); free(ff);
} }
void void
save_font_files(struct font_files*fonts) save_font_files(struct font_files*fonts)
{ {
...@@ -83,6 +85,7 @@ save_font_files(struct font_files*fonts) ...@@ -83,6 +85,7 @@ save_font_files(struct font_files*fonts)
} }
struct font_files* struct font_files*
read_font_files(int*count) read_font_files(int*count)
{ {
FILE *inifile; FILE *inifile;
...@@ -125,6 +128,7 @@ read_font_files(int*count) ...@@ -125,6 +128,7 @@ read_font_files(int*count)
strListFree(&fonts); strListFree(&fonts);
return ret; return ret;
} }
void void
load_font_files(void) load_font_files(void)
{ {
...@@ -196,6 +200,7 @@ load_font_files(void) ...@@ -196,6 +200,7 @@ load_font_files(void)
setfont(default_font, false, 0); setfont(default_font, false, 0);
font_names[i] = ""; font_names[i] = "";
} }
int int
find_font_id(char*name) find_font_id(char*name)
{ {
...@@ -212,6 +217,7 @@ find_font_id(char*name) ...@@ -212,6 +217,7 @@ find_font_id(char*name)
} }
return ret; return ret;
} }
void void
font_management(void) font_management(void)
{ {
...@@ -248,14 +254,14 @@ font_management(void) ...@@ -248,14 +254,14 @@ font_management(void)
opts[0][0] = 0; opts[0][0] = 0;
opt[0] = opts[0]; opt[0] = opts[0];
} }
i = uifc.list(WIN_SAV | WIN_INS | WIN_INSACT | WIN_DEL | WIN_XTR | WIN_ACT, i = uifc.list(WIN_SAV | WIN_INS | WIN_INSACT | WIN_DEL | WIN_XTR | WIN_ACT
0, , 0
0, , 0
0, , 0
&cur, , &cur
&bar, , &bar
"Font Management", , "Font Management"
opt); , opt);
if (i == -1) { if (i == -1) {
check_exit(false); check_exit(false);
save_font_files(fonts); save_font_files(fonts);
...@@ -273,8 +279,8 @@ font_management(void) ...@@ -273,8 +279,8 @@ font_management(void)
FREE_AND_NULL(fonts[cur].path8x8); FREE_AND_NULL(fonts[cur].path8x8);
FREE_AND_NULL(fonts[cur].path8x14); FREE_AND_NULL(fonts[cur].path8x14);
FREE_AND_NULL(fonts[cur].path8x16); FREE_AND_NULL(fonts[cur].path8x16);
memmove(&(fonts[cur]), &(fonts[cur + 1]), memmove(&(fonts[cur]), &(fonts[cur + 1])
sizeof(struct font_files) * (count - cur)); , sizeof(struct font_files) * (count - cur));
count--; count--;
} }
break; break;
...@@ -313,14 +319,14 @@ font_management(void) ...@@ -313,14 +319,14 @@ font_management(void)
sprintf(opts[2], "8x14 %.50s", fonts[cur].path8x14 ? fonts[cur].path8x14 : "<undefined>"); sprintf(opts[2], "8x14 %.50s", fonts[cur].path8x14 ? fonts[cur].path8x14 : "<undefined>");
sprintf(opts[3], "8x16 %.50s", fonts[cur].path8x16 ? fonts[cur].path8x16 : "<undefined>"); sprintf(opts[3], "8x16 %.50s", fonts[cur].path8x16 ? fonts[cur].path8x16 : "<undefined>");
opts[4][0] = 0; opts[4][0] = 0;
i = uifc.list(WIN_SAV | WIN_ACT | WIN_INS | WIN_INSACT | WIN_DEL | WIN_RHT | WIN_BOT, i = uifc.list(WIN_SAV | WIN_ACT | WIN_INS | WIN_INSACT | WIN_DEL | WIN_RHT | WIN_BOT
0, , 0
0, , 0
0, , 0
&fcur, , &fcur
&fbar, , &fbar
"Font Details", , "Font Details"
opt); , opt);
if (i == -1) { if (i == -1) {
check_exit(false); check_exit(false);
break; break;
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "term.h" #include "term.h"
#include "uifcinit.h" #include "uifcinit.h"
#include "window.h" #include "window.h"
void void
viewscroll(void) viewscroll(void)
{ {
...@@ -57,8 +58,8 @@ viewscroll(void) ...@@ -57,8 +58,8 @@ viewscroll(void)
top = 1; top = 1;
if (top > cterm->backpos) if (top > cterm->backpos)
top = cterm->backpos; top = cterm->backpos;
vmem_puttext(term.x - 1, term.y - 1, term.x + term.width - 2, term.y + term.height - 2, vmem_puttext(term.x - 1, term.y - 1, term.x + term.width - 2, term.y + term.height - 2
scrollback + (term.width * top)); , scrollback + (term.width * top));
cputs("Scrollback"); cputs("Scrollback");
gotoxy(cterm->width - 9, 1); gotoxy(cterm->width - 9, 1);
cputs("Scrollback"); cputs("Scrollback");
...@@ -140,6 +141,7 @@ viewscroll(void) ...@@ -140,6 +141,7 @@ viewscroll(void)
freescreen(savscrn); freescreen(savscrn);
return; return;
} }
int int
syncmenu(struct bbslist*bbs, int*speed) syncmenu(struct bbslist*bbs, int*speed)
{ {
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include "uifcinit.h" #include "uifcinit.h"
static COM_HANDLE com = COM_HANDLE_INVALID; static COM_HANDLE com = COM_HANDLE_INVALID;
void void
modem_input_thread(void*args) modem_input_thread(void*args)
{ {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -14,6 +14,7 @@ SOCKET rlogin_sock = INVALID_SOCKET; ...@@ -14,6 +14,7 @@ SOCKET rlogin_sock = INVALID_SOCKET;
#ifdef __BORLANDC__ #ifdef __BORLANDC__
#pragma argsused #pragma argsused
#endif #endif
void void
rlogin_input_thread(void*args) rlogin_input_thread(void*args)
{ {
...@@ -43,6 +44,7 @@ rlogin_input_thread(void*args) ...@@ -43,6 +44,7 @@ rlogin_input_thread(void*args)
#ifdef __BORLANDC__ #ifdef __BORLANDC__
#pragma argsused #pragma argsused
#endif #endif
void void
rlogin_output_thread(void*args) rlogin_output_thread(void*args)
{ {
...@@ -158,7 +160,6 @@ rlogin_connect(struct bbslist*bbs) ...@@ -158,7 +160,6 @@ rlogin_connect(struct bbslist*bbs)
if (strstr(rbuf, "ERROR\r\n")) if (strstr(rbuf, "ERROR\r\n"))
break; break;
/* We didn't receive the desired response in time, so bail. */ /* We didn't receive the desired response in time, so bail. */
if (idx >= sizeof(rbuf)) if (idx >= sizeof(rbuf))
return -1; return -1;
...@@ -187,7 +188,6 @@ rlogin_connect(struct bbslist*bbs) ...@@ -187,7 +188,6 @@ rlogin_connect(struct bbslist*bbs)
if (strstr(rbuf, "OK\r\n")) if (strstr(rbuf, "OK\r\n"))
break; break;
/* We didn't receive the desired response in time, so bail. */ /* We didn't receive the desired response in time, so bail. */
if (idx >= sizeof(rbuf)) if (idx >= sizeof(rbuf))
return -1; return -1;
...@@ -195,7 +195,6 @@ rlogin_connect(struct bbslist*bbs) ...@@ -195,7 +195,6 @@ rlogin_connect(struct bbslist*bbs)
if (ret < 1) if (ret < 1)
return -1; return -1;
} }
_beginthread(rlogin_output_thread, 0, NULL); _beginthread(rlogin_output_thread, 0, NULL);
......
...@@ -20,6 +20,7 @@ SOCKET ssh_sock; ...@@ -20,6 +20,7 @@ SOCKET ssh_sock;
CRYPT_SESSION ssh_session; CRYPT_SESSION ssh_session;
int ssh_active = true; int ssh_active = true;
pthread_mutex_t ssh_mutex; pthread_mutex_t ssh_mutex;
void void
cryptlib_error_message(int status, const char*msg) cryptlib_error_message(int status, const char*msg)
{ {
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
int crypt_loaded = 0; int crypt_loaded = 0;
#ifdef WITHOUT_CRYPTLIB #ifdef WITHOUT_CRYPTLIB
int int
init_crypt() init_crypt()
{ {
...@@ -26,6 +27,7 @@ exit_crypt() ...@@ -26,6 +27,7 @@ exit_crypt()
#else #else
struct crypt_funcs cl; struct crypt_funcs cl;
int int
init_crypt(void) init_crypt(void)
{ {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment