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
......@@ -48,7 +48,7 @@ struct FontList {
#endif
#if defined(PRAGMA_PACK)
#pragma pack(push,1) /* Disk image structures must be packed */
#pragma pack(push,1) /* Disk image structures must be packed */
#endif
struct _PACK FontHeader {
......@@ -70,7 +70,7 @@ struct _PACK FontHeader {
};
#if defined(PRAGMA_PACK)
#pragma pack(pop) /* original packing */
#pragma pack(pop) /* original packing */
#endif
#endif // ifndef AMIGAFONT_H
This diff is collapsed.
......@@ -14,7 +14,7 @@
#include "ini_file.h"
#if defined(_WIN32)
#include <malloc.h> /* alloca() on Win32 */
#include <malloc.h> /* alloca() on Win32 */
#endif
#include <cterm.h>
......
......@@ -48,12 +48,12 @@
struct conn_api conn_api;
char *conn_types_enum[] = {
"Unknown", "RLogin", "RLoginReversed", "Telnet", "Raw", "SSH", "SSHNA", "Modem", "Serial", "NoRTS", "Shell",
"MBBSGhost", "TelnetS", NULL
"Unknown", "RLogin", "RLoginReversed", "Telnet", "Raw", "SSH", "SSHNA", "Modem", "Serial", "NoRTS", "Shell"
, "MBBSGhost", "TelnetS", NULL
};
char *conn_types[] = {
"Unknown", "RLogin", "RLogin Reversed", "Telnet", "Raw", "SSH", "SSH (no auth)", "Modem", "Serial",
"3-wire (No RTS)", "Shell", "MBBS GHost", "TelnetS", NULL
"Unknown", "RLogin", "RLogin Reversed", "Telnet", "Raw", "SSH", "SSH (no auth)", "Modem", "Serial"
, "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};
......@@ -62,6 +62,7 @@ struct conn_buffer conn_outbuf;
/* Buffer functions */
struct conn_buffer*
create_conn_buf(struct conn_buffer*buf, size_t size)
{
buf->buf = (unsigned char*)malloc(size);
......@@ -88,6 +89,7 @@ create_conn_buf(struct conn_buffer*buf, size_t size)
}
return buf;
}
void
destroy_conn_buf(struct conn_buffer*buf)
{
......@@ -95,11 +97,13 @@ destroy_conn_buf(struct conn_buffer*buf)
FREE_AND_NULL(buf->buf);
while (pthread_mutex_destroy(&(buf->mutex)))
;
while (sem_destroy(&(buf->in_sem)));
while (sem_destroy(&(buf->in_sem)))
;
while (sem_destroy(&(buf->out_sem)))
;
}
}
/*
* The mutex should always be locked by the caller
* for the rest of the buffer functions
......@@ -114,11 +118,13 @@ conn_buf_bytes(struct conn_buffer*buf)
return buf->buftop - buf->bufbot;
return buf->bufsize - buf->bufbot + buf->buftop;
}
size_t
conn_buf_free(struct conn_buffer*buf)
{
return buf->bufsize - conn_buf_bytes(buf);
}
/*
* Copies up to outlen bytes from the buffer into outbuf,
* 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)
return copy_bytes;
}
/*
* Copies up to outlen bytes from the buffer into outbuf,
* 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)
}
return ret;
}
/*
* Places up to outlen bytes from outbuf 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)
}
return write_bytes;
}
/*
* Waits up to timeout milliseconds for bcount bytes to be available/free
* in the buffer.
......@@ -261,6 +270,7 @@ conn_buf_wait_cond(struct conn_buffer*buf, size_t bcount, unsigned long timeout,
pthread_mutex_unlock(&(buf->mutex));
}
}
/*
* Connection functions
*/
......@@ -271,6 +281,7 @@ conn_connected(void)
return true;
return false;
}
int
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;
}
int
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));
return found;
}
int
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;
}
int
conn_connect(struct bbslist*bbs)
{
......@@ -422,6 +436,7 @@ conn_connect(struct bbslist*bbs)
}
return conn_api.terminate;
}
size_t
conn_data_waiting(void)
{
......@@ -432,6 +447,7 @@ conn_data_waiting(void)
pthread_mutex_unlock(&(conn_inbuf.mutex));
return found;
}
int
conn_close(void)
{
......@@ -453,6 +469,7 @@ enum failure_reason {
,
FAILURE_DISCONNECTED
};
int
conn_socket_connect(struct bbslist*bbs)
{
......@@ -613,6 +630,7 @@ connected:
closesocket(sock);
return INVALID_SOCKET;
}
void
conn_binary_mode_on(void)
{
......@@ -620,6 +638,7 @@ conn_binary_mode_on(void)
conn_api.binary_mode_on();
conn_api.binary_mode = true;
}
void
conn_binary_mode_off(void)
{
......
......@@ -40,7 +40,7 @@
#define CEOF CTRL('d')
#endif
#ifndef CEOL
#define CEOL 0xff /* XXX avoid _POSIX_VDISABLE */
#define CEOL 0xff /* XXX avoid _POSIX_VDISABLE */
#endif
#ifndef CERASE
#define CERASE 0177
......@@ -61,7 +61,7 @@
#define CMIN 1
#endif
#ifndef CQUIT
#define CQUIT 034 /* FS, ^\ */
#define CQUIT 034 /* FS, ^\ */
#endif
#ifndef CSUSP
#define CSUSP CTRL('z')
......@@ -145,6 +145,7 @@ static cc_t ttydefchars[NCCS] = {
extern int default_font;
#ifdef NEEDS_CFMAKERAW
void
cfmakeraw(struct termios*t)
{
......@@ -158,6 +159,7 @@ cfmakeraw(struct termios*t)
#endif
#ifdef NEEDS_FORKPTY
static int
login_tty(int fd)
{
......@@ -173,6 +175,7 @@ login_tty(int fd)
}
#ifdef NEEDS_DAEMON
/*
* **************************************************************************
* Daemonizes the process
......@@ -209,6 +212,7 @@ daemon(int nochdir, int noclose)
}
#endif /* ifdef NEEDS_DAEMON */
static int
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
errno = ENOENT; /* out of ptys */
return -1;
}
static int
forkpty(int*amaster, char*name, struct termios*termp, struct winsize*winp)
{
......@@ -294,6 +299,7 @@ static int status;
#ifdef __BORLANDC__
#pragma argsused
#endif
void
pty_input_thread(void*args)
{
......@@ -344,6 +350,7 @@ pty_input_thread(void*args)
#ifdef __BORLANDC__
#pragma argsused
#endif
void
pty_output_thread(void*args)
{
......@@ -399,6 +406,7 @@ pty_output_thread(void*args)
}
conn_api.output_thread_running = 2;
}
int
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"
":ta=^I:up=\\E[A:ve=\\E[?25h:vi=\\E[?25l:vs=\\E[?25h:"
,
ws.ws_col,
ws.ws_col
,
ws.ws_row
,
cio_api.options
......@@ -500,6 +509,7 @@ pty_connect(struct bbslist*bbs)
return 0;
}
int
pty_close(void)
{
......
......@@ -12,6 +12,7 @@
#include "syncterm.h"
#include "uifc.h"
#include "uifcinit.h"
void
free_font_files(struct font_files*ff)
{
......@@ -27,6 +28,7 @@ free_font_files(struct font_files*ff)
}
free(ff);
}
void
save_font_files(struct font_files*fonts)
{
......@@ -83,6 +85,7 @@ save_font_files(struct font_files*fonts)
}
struct font_files*
read_font_files(int*count)
{
FILE *inifile;
......@@ -125,6 +128,7 @@ read_font_files(int*count)
strListFree(&fonts);
return ret;
}
void
load_font_files(void)
{
......@@ -196,6 +200,7 @@ load_font_files(void)
setfont(default_font, false, 0);
font_names[i] = "";
}
int
find_font_id(char*name)
{
......@@ -212,6 +217,7 @@ find_font_id(char*name)
}
return ret;
}
void
font_management(void)
{
......@@ -248,14 +254,14 @@ font_management(void)
opts[0][0] = 0;
opt[0] = opts[0];
}
i = uifc.list(WIN_SAV | WIN_INS | WIN_INSACT | WIN_DEL | WIN_XTR | WIN_ACT,
0,
0,
0,
&cur,
&bar,
"Font Management",
opt);
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);
save_font_files(fonts);
......@@ -273,8 +279,8 @@ font_management(void)
FREE_AND_NULL(fonts[cur].path8x8);
FREE_AND_NULL(fonts[cur].path8x14);
FREE_AND_NULL(fonts[cur].path8x16);
memmove(&(fonts[cur]), &(fonts[cur + 1]),
sizeof(struct font_files) * (count - cur));
memmove(&(fonts[cur]), &(fonts[cur + 1])
, sizeof(struct font_files) * (count - cur));
count--;
}
break;
......@@ -313,14 +319,14 @@ font_management(void)
sprintf(opts[2], "8x14 %.50s", fonts[cur].path8x14 ? fonts[cur].path8x14 : "<undefined>");
sprintf(opts[3], "8x16 %.50s", fonts[cur].path8x16 ? fonts[cur].path8x16 : "<undefined>");
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);
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);
break;
......
......@@ -14,6 +14,7 @@
#include "term.h"
#include "uifcinit.h"
#include "window.h"
void
viewscroll(void)
{
......@@ -57,8 +58,8 @@ viewscroll(void)
top = 1;
if (top > cterm->backpos)
top = cterm->backpos;
vmem_puttext(term.x - 1, term.y - 1, term.x + term.width - 2, term.y + term.height - 2,
scrollback + (term.width * top));
vmem_puttext(term.x - 1, term.y - 1, term.x + term.width - 2, term.y + term.height - 2
, scrollback + (term.width * top));
cputs("Scrollback");
gotoxy(cterm->width - 9, 1);
cputs("Scrollback");
......@@ -140,6 +141,7 @@ viewscroll(void)
freescreen(savscrn);
return;
}
int
syncmenu(struct bbslist*bbs, int*speed)
{
......
......@@ -15,6 +15,7 @@
#include "uifcinit.h"
static COM_HANDLE com = COM_HANDLE_INVALID;
void
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.
This diff is collapsed.
......@@ -20,6 +20,7 @@ SOCKET ssh_sock;
CRYPT_SESSION ssh_session;
int ssh_active = true;
pthread_mutex_t ssh_mutex;
void
cryptlib_error_message(int status, const char*msg)
{
......
This diff is collapsed.
This diff is collapsed.
......@@ -9,7 +9,7 @@
#include "bbslist.h"
#if defined(_WIN32)
#include <malloc.h> /* alloca() on Win32 */
#include <malloc.h> /* alloca() on Win32 */
#endif
enum {
......
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment