Commits (1)
This diff is collapsed.
......@@ -109,10 +109,10 @@ struct bbslist {
char comment[1024];
};
extern char*music_names[];
extern char music_helpbuf[];
extern char *music_names[];
extern char music_helpbuf[];
struct bbslist *show_bbslist(char*current, int connected);
struct bbslist *show_bbslist(char *current, int connected);
extern char *log_levels[];
extern char *rate_names[];
......@@ -120,14 +120,14 @@ extern int rates[];
extern int sortorder[];
extern ini_style_t ini_style;
extern char *screen_modes_enum[];
void read_item(str_list_t listfile, struct bbslist*entry, char*bbsname, int id, int type);
void read_list(char*listpath, struct bbslist**list, struct bbslist*defaults, int*i, int type);
void free_list(struct bbslist**list, int listcount);
void add_bbs(char*listpath, struct bbslist*bbs);
int edit_list(struct bbslist**list, struct bbslist*item, char*listpath, int isdefault);
void read_item(str_list_t listfile, struct bbslist *entry, char *bbsname, int id, int type);
void read_list(char *listpath, struct bbslist **list, struct bbslist *defaults, int *i, int type);
void free_list(struct bbslist **list, int listcount);
void add_bbs(char *listpath, struct bbslist *bbs);
int edit_list(struct bbslist **list, struct bbslist *item, char *listpath, int isdefault);
int get_rate_num(int rate);
cterm_emulation_t get_emulation(struct bbslist*bbs);
cterm_emulation_t get_emulation(struct bbslist *bbs);
const char *get_emulation_str(cterm_emulation_t emu);
void get_term_size(struct bbslist*bbs, int*cols, int*rows);
void get_term_size(struct bbslist *bbs, int *cols, int *rows);
#endif // ifndef _BBSLIST_H_
......@@ -61,11 +61,11 @@ struct conn_buffer conn_inbuf;
struct conn_buffer conn_outbuf;
/* 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);
if (buf->buf == NULL)
return NULL;
buf->bufsize = size;
......@@ -91,7 +91,7 @@ create_conn_buf(struct conn_buffer*buf, size_t size)
}
void
destroy_conn_buf(struct conn_buffer*buf)
destroy_conn_buf(struct conn_buffer *buf)
{
if (buf->buf != NULL) {
FREE_AND_NULL(buf->buf);
......@@ -109,7 +109,7 @@ destroy_conn_buf(struct conn_buffer*buf)
* for the rest of the buffer functions
*/
size_t
conn_buf_bytes(struct conn_buffer*buf)
conn_buf_bytes(struct conn_buffer *buf)
{
if (buf->isempty)
return 0;
......@@ -120,7 +120,7 @@ conn_buf_bytes(struct conn_buffer*buf)
}
size_t
conn_buf_free(struct conn_buffer*buf)
conn_buf_free(struct conn_buffer *buf)
{
return buf->bufsize - conn_buf_bytes(buf);
}
......@@ -131,11 +131,11 @@ conn_buf_free(struct conn_buffer*buf)
* copied out of the buffer
*/
size_t
conn_buf_peek(struct conn_buffer*buf, void*voutbuf, size_t outlen)
conn_buf_peek(struct conn_buffer *buf, void *voutbuf, size_t outlen)
{
unsigned char*outbuf = (unsigned char*)voutbuf;
size_t copy_bytes;
size_t chunk;
unsigned char *outbuf = (unsigned char *)voutbuf;
size_t copy_bytes;
size_t chunk;
copy_bytes = conn_buf_bytes(buf);
if (copy_bytes > outlen)
......@@ -158,11 +158,11 @@ conn_buf_peek(struct conn_buffer*buf, void*voutbuf, size_t outlen)
* bytes removed from the buffer.
*/
size_t
conn_buf_get(struct conn_buffer*buf, void*voutbuf, size_t outlen)
conn_buf_get(struct conn_buffer *buf, void *voutbuf, size_t outlen)
{
unsigned char*outbuf = (unsigned char*)voutbuf;
size_t ret;
size_t atstart;
unsigned char *outbuf = (unsigned char *)voutbuf;
size_t ret;
size_t atstart;
atstart = conn_buf_bytes(buf);
ret = conn_buf_peek(buf, outbuf, outlen);
......@@ -182,11 +182,11 @@ conn_buf_get(struct conn_buffer*buf, void*voutbuf, size_t outlen)
* returns the number of bytes written into the buffer
*/
size_t
conn_buf_put(struct conn_buffer*buf, const void*voutbuf, size_t outlen)
conn_buf_put(struct conn_buffer *buf, const void *voutbuf, size_t outlen)
{
const unsigned char*outbuf = (unsigned char*)voutbuf;
size_t write_bytes;
size_t chunk;
const unsigned char *outbuf = (unsigned char *)voutbuf;
size_t write_bytes;
size_t chunk;
write_bytes = conn_buf_free(buf);
if (write_bytes > outlen)
......@@ -213,7 +213,7 @@ conn_buf_put(struct conn_buffer*buf, const void*voutbuf, size_t outlen)
* in the buffer.
*/
size_t
conn_buf_wait_cond(struct conn_buffer*buf, size_t bcount, unsigned long timeout, int do_free)
conn_buf_wait_cond(struct conn_buffer *buf, size_t bcount, unsigned long timeout, int do_free)
{
long double now;
long double end;
......@@ -222,7 +222,7 @@ conn_buf_wait_cond(struct conn_buffer*buf, size_t bcount, unsigned long timeout,
int retnow = 0;
sem_t *sem;
size_t (*cond)(struct conn_buffer*buf);
size_t (*cond)(struct conn_buffer *buf);
if (do_free) {
sem = &(buf->out_sem);
......@@ -283,9 +283,9 @@ conn_connected(void)
}
int
conn_recv_upto(void*vbuffer, size_t buflen, unsigned timeout)
conn_recv_upto(void *vbuffer, size_t buflen, unsigned timeout)
{
char *buffer = (char*)vbuffer;
char *buffer = (char *)vbuffer;
size_t found = 0;
size_t obuflen;
void *expanded;
......@@ -317,10 +317,10 @@ conn_recv_upto(void*vbuffer, size_t buflen, unsigned timeout)
}
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)
{
const char*buffer = vbuffer;
size_t found;
const char *buffer = vbuffer;
size_t found;
pthread_mutex_lock(&(conn_outbuf.mutex));
found = conn_buf_wait_free(&conn_outbuf, buflen, timeout);
......@@ -331,18 +331,18 @@ conn_send_raw(const void*vbuffer, size_t buflen, unsigned int timeout)
}
int
conn_send(const void*vbuffer, size_t buflen, unsigned int timeout)
conn_send(const void *vbuffer, size_t buflen, unsigned int timeout)
{
const char*buffer = vbuffer;
size_t found;
size_t obuflen;
void *expanded;
const char *buffer = vbuffer;
size_t found;
size_t obuflen;
void *expanded;
if (conn_api.tx_parse_cb != NULL) {
expanded = conn_api.tx_parse_cb(buffer, buflen, &obuflen);
}
else {
expanded = (void*)buffer;
expanded = (void *)buffer;
obuflen = buflen;
}
......@@ -359,7 +359,7 @@ conn_send(const void*vbuffer, size_t buflen, unsigned int timeout)
}
int
conn_connect(struct bbslist*bbs)
conn_connect(struct bbslist *bbs)
{
char str[64];
......@@ -457,30 +457,25 @@ conn_close(void)
}
enum failure_reason {
FAILURE_WHAT_FAILURE
,
FAILURE_RESOLVE
,
FAILURE_CANT_CREATE
,
FAILURE_CONNECT_ERROR
,
FAILURE_ABORTED
,
FAILURE_WHAT_FAILURE,
FAILURE_RESOLVE,
FAILURE_CANT_CREATE,
FAILURE_CONNECT_ERROR,
FAILURE_ABORTED,
FAILURE_DISCONNECTED
};
int
conn_socket_connect(struct bbslist*bbs)
conn_socket_connect(struct bbslist *bbs)
{
SOCKET sock = INVALID_SOCKET;
int nonblock;
int failcode = FAILURE_WHAT_FAILURE;
struct addrinfo hints;
struct addrinfo*res = NULL;
struct addrinfo*cur;
char portnum[6];
char str[LIST_ADDR_MAX + 40];
SOCKET sock = INVALID_SOCKET;
int nonblock;
int failcode = FAILURE_WHAT_FAILURE;
struct addrinfo hints;
struct addrinfo *res = NULL;
struct addrinfo *cur;
char portnum[6];
char str[LIST_ADDR_MAX + 40];
if (!bbs->hidepopups)
uifc.pop("Looking up host");
......@@ -575,7 +570,7 @@ connected:
ioctlsocket(sock, FIONBIO, &nonblock);
if (!socket_recvdone(sock, 0)) {
int keepalives = true;
setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, (void*)&keepalives, sizeof(keepalives));
setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, (void *)&keepalives, sizeof(keepalives));
if (!bbs->hidepopups)
uifc.pop(NULL);
......
......@@ -33,15 +33,15 @@ enum {
};
struct conn_api {
int (*connect)(struct bbslist*bbs);
int (*connect)(struct bbslist *bbs);
int (*close)(void);
void (*binary_mode_on)(void);
void (*binary_mode_off)(void);
bool binary_mode;
void * (*rx_parse_cb)(const void*inbuf, size_t inlen, size_t*olen);
void * (*tx_parse_cb)(const void*inbuf, size_t inlen, size_t*olen);
void * (*rx_parse_cb)(const void *inbuf, size_t inlen, size_t *olen);
void * (*tx_parse_cb)(const void *inbuf, size_t inlen, size_t *olen);
int log_level;
int type;
......@@ -70,10 +70,10 @@ struct conn_buffer {
/*
* Functions for stuff using connections
*/
int conn_recv_upto(void*buffer, size_t buflen, unsigned int timeout);
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_recv_upto(void *buffer, size_t buflen, unsigned int timeout);
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);
size_t conn_data_waiting(void);
......@@ -90,16 +90,16 @@ extern struct conn_buffer conn_inbuf;
extern struct conn_buffer conn_outbuf;
extern struct conn_api conn_api;
struct conn_buffer *create_conn_buf(struct conn_buffer*buf, size_t size);
void destroy_conn_buf(struct conn_buffer*buf);
size_t conn_buf_bytes(struct conn_buffer*buf);
size_t conn_buf_peek(struct conn_buffer*buf, void*voutbuf, size_t outlen);
size_t conn_buf_get(struct conn_buffer*buf, void*outbuf, size_t outlen);
size_t conn_buf_put(struct conn_buffer*buf, const void*outbuf, size_t outlen);
size_t conn_buf_wait_cond(struct conn_buffer*buf, size_t bcount, unsigned long timeout, int do_free);
struct conn_buffer *create_conn_buf(struct conn_buffer *buf, size_t size);
void destroy_conn_buf(struct conn_buffer *buf);
size_t conn_buf_bytes(struct conn_buffer *buf);
size_t conn_buf_peek(struct conn_buffer *buf, void *voutbuf, size_t outlen);
size_t conn_buf_get(struct conn_buffer *buf, void *outbuf, size_t outlen);
size_t conn_buf_put(struct conn_buffer *buf, const void *outbuf, size_t outlen);
size_t conn_buf_wait_cond(struct conn_buffer *buf, size_t bcount, unsigned long timeout, int do_free);
#define conn_buf_wait_bytes(buf, count, timeout) conn_buf_wait_cond(buf, count, timeout, 0)
#define conn_buf_wait_free(buf, count, timeout) conn_buf_wait_cond(buf, count, timeout, 1)
int conn_socket_connect(struct bbslist*bbs);
int conn_socket_connect(struct bbslist *bbs);
#endif // ifndef _CONN_H_
......@@ -147,7 +147,7 @@ extern int default_font;
#ifdef NEEDS_CFMAKERAW
void
cfmakeraw(struct termios*t)
cfmakeraw(struct termios *t)
{
t->c_iflag &= ~(IMAXBEL | IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON);
t->c_oflag &= ~OPOST;
......@@ -214,12 +214,12 @@ daemon(int nochdir, int noclose)
#endif /* ifdef NEEDS_DAEMON */
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)
{
char line[] = "/dev/ptyXX";
const char *cp1, *cp2;
int master, slave, ttygid;
struct group*gr;
char line[] = "/dev/ptyXX";
const char *cp1, *cp2;
int master, slave, ttygid;
struct group *gr;
if ((gr = getgrnam("tty")) != NULL)
ttygid = gr->gr_gid;
......@@ -252,7 +252,7 @@ openpty(int*amaster, int*aslave, char*name, struct termios*termp, struct winsize
, TCSAFLUSH, termp);
if (winp)
(void)ioctl(slave, TIOCSWINSZ
, (char*)winp);
, (char *)winp);
return 0;
}
(void)close(master);
......@@ -264,7 +264,7 @@ openpty(int*amaster, int*aslave, char*name, struct termios*termp, struct winsize
}
static int
forkpty(int*amaster, char*name, struct termios*termp, struct winsize*winp)
forkpty(int *amaster, char *name, struct termios *termp, struct winsize *winp)
{
int master, slave, pid;
......@@ -301,7 +301,7 @@ static int status;
#endif
void
pty_input_thread(void*args)
pty_input_thread(void *args)
{
fd_set rds;
int rd;
......@@ -352,7 +352,7 @@ pty_input_thread(void*args)
#endif
void
pty_output_thread(void*args)
pty_output_thread(void *args)
{
fd_set wds;
int wr;
......@@ -408,7 +408,7 @@ pty_output_thread(void*args)
}
int
pty_connect(struct bbslist*bbs)
pty_connect(struct bbslist *bbs)
{
struct winsize ws;
struct termios ts;
......@@ -475,11 +475,11 @@ pty_connect(struct bbslist*bbs)
xp_asprintf_free(termcap);
setenv("MM_CHARSET", ciolib_cp[cp].name, 1);
if (bbs->addr[0]) {
execl("/bin/sh", "/bin/sh", "-c", bbs->addr, (char*)0);
execl("/bin/sh", "/bin/sh", "-c", bbs->addr, (char *)0);
}
else {
if (getenv("SHELL"))
execl(getenv("SHELL"), getenv("SHELL"), (char*)0);
execl(getenv("SHELL"), getenv("SHELL"), (char *)0);
}
exit(1);
}
......@@ -490,13 +490,13 @@ pty_connect(struct bbslist*bbs)
destroy_conn_buf(&conn_inbuf);
return -1;
}
if (!(conn_api.rd_buf = (unsigned char*)malloc(BUFFER_SIZE))) {
if (!(conn_api.rd_buf = (unsigned char *)malloc(BUFFER_SIZE))) {
destroy_conn_buf(&conn_inbuf);
destroy_conn_buf(&conn_outbuf);
return -1;
}
conn_api.rd_buf_size = BUFFER_SIZE;
if (!(conn_api.wr_buf = (unsigned char*)malloc(BUFFER_SIZE))) {
if (!(conn_api.wr_buf = (unsigned char *)malloc(BUFFER_SIZE))) {
free(conn_api.rd_buf);
destroy_conn_buf(&conn_inbuf);
destroy_conn_buf(&conn_outbuf);
......
......@@ -2,7 +2,7 @@
#ifndef _CONN_PTY_H_
#define _CONN_PTY_H_
int pty_connect(struct bbslist*bbs);
int pty_connect(struct bbslist *bbs);
int pty_close(void);
#endif
......@@ -26,15 +26,15 @@ extern int telnet_log_level;
/*****************************************************************************/
static size_t
st_telnet_expand(const uchar*inbuf, size_t inlen, uchar*outbuf, size_t outlen, bool expand_cr, uchar**result)
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);
BYTE *first_iac = (BYTE *)memchr(inbuf, TELNET_IAC, inlen);
BYTE *first_cr = NULL;
if (inlen == 0) {
if (result != NULL)
*result = (uchar*)inbuf;
*result = (uchar *)inbuf;
return 0;
}
if (last_was_lf && (inbuf[0] == '\n')) {
......@@ -43,13 +43,13 @@ st_telnet_expand(const uchar*inbuf, size_t inlen, uchar*outbuf, size_t outlen, b
}
last_was_lf = false;
if (expand_cr)
first_cr = (BYTE*)memchr(inbuf, '\r', inlen);
first_cr = (BYTE *)memchr(inbuf, '\r', inlen);
else
last_was_lf = false;
if ((first_iac == NULL) && (first_cr == NULL)) { /* Nothing to expand */
if (result != NULL)
*result = (uchar*)inbuf;
*result = (uchar *)inbuf;
return inlen;
}
......@@ -80,27 +80,27 @@ st_telnet_expand(const uchar*inbuf, size_t inlen, uchar*outbuf, size_t outlen, b
return o;
}
void*
telnet_rx_parse_cb(const void*buf, size_t inlen, size_t*olen)
void *
telnet_rx_parse_cb(const void *buf, size_t inlen, size_t *olen)
{
// telnet_interpret() can add up to one byte to inbuf ('\r')
void*ret = malloc(inlen + 1);
void *ret = malloc(inlen + 1);
if (ret == NULL)
return ret;
if (telnet_interpret((BYTE*)buf, inlen, ret, olen) != ret)
if (telnet_interpret((BYTE *)buf, inlen, ret, olen) != ret)
memcpy(ret, buf, *olen);
return ret;
}
void*
telnet_tx_parse_cb(const void*buf, size_t len, size_t*olen)
void *
telnet_tx_parse_cb(const void *buf, size_t len, size_t *olen)
{
void*ret = malloc(len * 2);
void*parsed;
void *ret = malloc(len * 2);
void *parsed;
*olen = st_telnet_expand(buf, len, ret, len * 2
, telnet_local_option[TELNET_BINARY_TX] != TELNET_DO, (BYTE**)&parsed);
, telnet_local_option[TELNET_BINARY_TX] != TELNET_DO, (BYTE **)&parsed);
if (parsed != ret)
memcpy(ret, parsed, *olen);
......@@ -109,7 +109,7 @@ telnet_tx_parse_cb(const void*buf, size_t len, size_t*olen)
}
int
telnet_connect(struct bbslist*bbs)
telnet_connect(struct bbslist *bbs)
{
if (!bbs->hidepopups)
init_uifc(true, true);
......@@ -126,14 +126,14 @@ telnet_connect(struct bbslist*bbs)
destroy_conn_buf(&conn_inbuf);
return -1;
}
conn_api.rd_buf = (unsigned char*)malloc(BUFFER_SIZE);
conn_api.rd_buf = (unsigned char *)malloc(BUFFER_SIZE);
if (!conn_api.rd_buf) {
destroy_conn_buf(&conn_inbuf);
destroy_conn_buf(&conn_outbuf);
return -1;
}
conn_api.rd_buf_size = BUFFER_SIZE;
conn_api.wr_buf = (unsigned char*)malloc(BUFFER_SIZE);
conn_api.wr_buf = (unsigned char *)malloc(BUFFER_SIZE);
if (!conn_api.wr_buf) {
FREE_AND_NULL(conn_api.rd_buf);
destroy_conn_buf(&conn_inbuf);
......
......@@ -8,9 +8,9 @@
extern SOCKET telnet_sock;
void telnet_binary_mode_on(void);
void telnet_binary_mode_off(void);
int telnet_connect(struct bbslist*bbs);
void *telnet_rx_parse_cb(const void*buf, size_t inlen, size_t*olen);
void *telnet_tx_parse_cb(const void*buf, size_t len, size_t*olen);
int telnet_connect(struct bbslist *bbs);
void *telnet_rx_parse_cb(const void *buf, size_t inlen, size_t *olen);
void *telnet_tx_parse_cb(const void *buf, size_t len, size_t *olen);
#define telnet_close rlogin_close
......
......@@ -14,7 +14,7 @@
#include "uifcinit.h"
void
free_font_files(struct font_files*ff)
free_font_files(struct font_files *ff)
{
int i;
......@@ -30,7 +30,7 @@ free_font_files(struct font_files*ff)
}
void
save_font_files(struct font_files*fonts)
save_font_files(struct font_files *fonts)
{
FILE *inifile;
char inipath[MAX_PATH + 1];
......@@ -84,17 +84,17 @@ save_font_files(struct font_files*fonts)
strListFree(&ini_file);
}
struct font_files*
struct font_files *
read_font_files(int*count)
read_font_files(int *count)
{
FILE *inifile;
char inipath[MAX_PATH + 1];
char fontpath[MAX_PATH + 1];
char *fontid;
str_list_t fonts;
struct font_files*ret = NULL;
struct font_files*tmp;
FILE *inifile;
char inipath[MAX_PATH + 1];
char fontpath[MAX_PATH + 1];
char *fontid;
str_list_t fonts;
struct font_files *ret = NULL;
struct font_files *tmp;
*count = 0;
get_syncterm_filename(inipath, sizeof(inipath), SYNCTERM_PATH_INI, false);
......@@ -107,7 +107,7 @@ read_font_files(int*count)
continue;
}
(*count)++;
tmp = (struct font_files*)realloc(ret, sizeof(struct font_files) * (*count + 1));
tmp = (struct font_files *)realloc(ret, sizeof(struct font_files) * (*count + 1));
if (tmp == NULL) {
count--;
free(fontid);
......@@ -132,12 +132,12 @@ read_font_files(int*count)
void
load_font_files(void)
{
int count = 0;
int i;
int nextfont = CONIO_FIRST_FREE_FONT;
struct font_files*ff;
FILE *fontfile;
char *fontdata;
int count = 0;
int i;
int nextfont = CONIO_FIRST_FREE_FONT;
struct font_files *ff;
FILE *fontfile;
char *fontdata;
ff = read_font_files(&count);
for (i = 0; i < count; i++) {
......@@ -155,7 +155,7 @@ load_font_files(void)
continue;
if (ff[i].path8x8 && ff[i].path8x8[0]) {
if ((fontfile = fopen(ff[i].path8x8, "rb")) != NULL) {
if ((fontdata = (char*)malloc(2048)) != NULL) {
if ((fontdata = (char *)malloc(2048)) != NULL) {
if (fread(fontdata, 1, 2048, fontfile) == 2048)
conio_fontdata[nextfont].eight_by_eight = fontdata;
else
......@@ -166,7 +166,7 @@ load_font_files(void)
}
if (ff[i].path8x14 && ff[i].path8x14[0]) {
if ((fontfile = fopen(ff[i].path8x14, "rb")) != NULL) {
if ((fontdata = (char*)malloc(3584)) != NULL) {
if ((fontdata = (char *)malloc(3584)) != NULL) {
if (fread(fontdata, 1, 3584, fontfile) == 3584)
conio_fontdata[nextfont].eight_by_fourteen = fontdata;
else
......@@ -177,7 +177,7 @@ load_font_files(void)
}
if (ff[i].path8x16 && ff[i].path8x16[0]) {
if ((fontfile = fopen(ff[i].path8x16, "rb")) != NULL) {
if ((fontdata = (char*)malloc(4096)) != NULL) {
if ((fontdata = (char *)malloc(4096)) != NULL) {
if (fread(fontdata, 1, 4096, fontfile) == 4096)
conio_fontdata[nextfont].eight_by_sixteen = fontdata;
else
......@@ -202,7 +202,7 @@ load_font_files(void)
}
int
find_font_id(char*name)
find_font_id(char *name)
{
int ret = 0;
int i;
......@@ -221,17 +221,17 @@ find_font_id(char*name)
void
font_management(void)
{
int i, j;
int cur = 0;
int bar = 0;
int fcur = 0;
int fbar = 0;
int count = 0;
struct font_files*fonts;
char *opt[256];
char opts[5][80];
struct font_files*tmp;
char str[128];
int i, j;
int cur = 0;
int bar = 0;
int fcur = 0;
int fbar = 0;
int count = 0;
struct font_files *fonts;
char *opt[256];
char opts[5][80];
struct font_files *tmp;
char str[128];
fonts = read_font_files(&count);
opts[4][0] = 0;
......@@ -269,9 +269,9 @@ font_management(void)
return;
}
for (; !quitting;) {
char *fontmask;
int show_filepick = 0;
char**path;
char *fontmask;
int show_filepick = 0;
char **path;
if (i & MSK_DEL) {
if (fonts) {
......@@ -293,7 +293,7 @@ font_management(void)
break;
}
count++;
tmp = (struct font_files*)realloc(fonts, sizeof(struct font_files) * (count + 1));
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);
......@@ -364,10 +364,10 @@ font_management(void)
break;
}
if (show_filepick && !safe_mode) {
int result;
struct file_pick fpick;
struct vmem_cell*savbuf;
struct text_info ti;
int result;
struct file_pick fpick;
struct vmem_cell *savbuf;
struct text_info ti;
gettextinfo(&ti);
savbuf = alloca((ti.screenheight - 2) * ti.screenwidth * sizeof(*savbuf));
......
......@@ -4,17 +4,17 @@
#define _SYNCTERM_FONTS_H
struct font_files {
char*name;
char*path8x8;
char*path8x14;
char*path8x16;
char *name;
char *path8x8;
char *path8x14;
char *path8x16;
};
void free_font_files(struct font_files*ff);
void save_font_files(struct font_files*fonts);
struct font_files *read_font_files(int*count);
void free_font_files(struct font_files *ff);
void save_font_files(struct font_files *fonts);
struct font_files *read_font_files(int *count);
void load_font_files(void);
int find_font_id(char*name);
int find_font_id(char *name);
void font_management(void);
#endif // ifndef _SYNCTERM_FONTS_H
......@@ -18,14 +18,14 @@
void
viewscroll(void)
{
int top;
int key;
int i;
struct vmem_cell *scrollback;
struct text_info txtinfo;
int x, y;
struct mouse_event mevent;
struct ciolib_screen*savscrn;
int top;
int key;
int i;
struct vmem_cell *scrollback;
struct text_info txtinfo;
int x, y;
struct mouse_event mevent;
struct ciolib_screen *savscrn;
x = wherex();
y = wherey();
......@@ -143,9 +143,9 @@ viewscroll(void)
}
int
syncmenu(struct bbslist*bbs, int*speed)
syncmenu(struct bbslist *bbs, int *speed)
{
char *opts[] = {
char *opts[] = {
"Scrollback ("ALT_KEY_NAMEP "-B)"
, "Disconnect (Ctrl-Q)"
, "Send Login ("ALT_KEY_NAMEP "-L)"
......@@ -164,11 +164,11 @@ syncmenu(struct bbslist*bbs, int*speed)
, "Edit Dialing Directory ("ALT_KEY_NAMEP "-E)"
, ""
};
int opt = 0;
int i, j;
struct text_info txtinfo;
struct ciolib_screen*savscrn;
int ret;
int opt = 0;
int i, j;
struct text_info txtinfo;
struct ciolib_screen *savscrn;
int ret;
gettextinfo(&txtinfo);
savscrn = savescreen();
......
......@@ -4,7 +4,7 @@
#define _MENU_H_
#include "bbslist.h"
int syncmenu(struct bbslist*, int*speed);
int syncmenu(struct bbslist *, int *speed);
void viewscroll(void);
#endif
......@@ -17,7 +17,7 @@
static COM_HANDLE com = COM_HANDLE_INVALID;
void
modem_input_thread(void*args)
modem_input_thread(void *args)
{
int rd;
int buffered;
......@@ -31,7 +31,7 @@ modem_input_thread(void*args)
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);
rd = comReadBuf(com, (char *)conn_api.rd_buf, conn_api.rd_buf_size, NULL, 100);
buffered = 0;
while (buffered < rd) {
pthread_mutex_lock(&(conn_inbuf.mutex));
......@@ -54,7 +54,7 @@ modem_input_thread(void*args)
}
void
modem_output_thread(void*args)
modem_output_thread(void *args)
{
int wr;
int ret;
......@@ -97,7 +97,7 @@ modem_output_thread(void*args)
}
int
modem_response(char*str, size_t maxlen, int timeout)
modem_response(char *str, size_t maxlen, int timeout)
{
char ch;
size_t len = 0;
......@@ -119,7 +119,7 @@ modem_response(char*str, size_t maxlen, int timeout)
return -1;
if (len >= maxlen)
return -1;
if (!comReadByte(com, (unsigned char*)&ch)) {
if (!comReadByte(com, (unsigned char *)&ch)) {
YIELD();
continue;
}
......@@ -138,7 +138,7 @@ modem_response(char*str, size_t maxlen, int timeout)
}
int
modem_connect(struct bbslist*bbs)
modem_connect(struct bbslist *bbs)
{
int ret;
char respbuf[1024];
......@@ -306,14 +306,14 @@ modem_connect(struct bbslist*bbs)
destroy_conn_buf(&conn_inbuf);
return -1;
}
if (!(conn_api.rd_buf = (unsigned char*)malloc(BUFFER_SIZE))) {
if (!(conn_api.rd_buf = (unsigned char *)malloc(BUFFER_SIZE))) {
conn_api.close();
destroy_conn_buf(&conn_inbuf);
destroy_conn_buf(&conn_outbuf);
return -1;
}
conn_api.rd_buf_size = BUFFER_SIZE;
if (!(conn_api.wr_buf = (unsigned char*)malloc(BUFFER_SIZE))) {
if (!(conn_api.wr_buf = (unsigned char *)malloc(BUFFER_SIZE))) {
conn_api.close();
destroy_conn_buf(&conn_inbuf);
destroy_conn_buf(&conn_outbuf);
......@@ -323,8 +323,8 @@ modem_connect(struct bbslist*bbs)
conn_api.wr_buf_size = BUFFER_SIZE;
if (bbs->conn_type == CONN_TYPE_SERIAL) {
_beginthread(modem_output_thread, 0, (void*)-1);
_beginthread(modem_input_thread, 0, (void*)-1);
_beginthread(modem_output_thread, 0, (void *)-1);
_beginthread(modem_input_thread, 0, (void *)-1);
}
else {
_beginthread(modem_output_thread, 0, NULL);
......
......@@ -4,7 +4,7 @@
#define _MODEM_H_
#include "bbslist.h"
int modem_connect(struct bbslist*bbs);
int modem_connect(struct bbslist *bbs);
int serial_close(void);
int modem_close(void);
......
......@@ -267,7 +267,7 @@ readInPix(char codeCh, int ooii_mode)
if ((codeCh >= 'A') && (codeCh <= 'E')) {
cterm_write(cterm
, ooii_cmenus[ooii_mode - 1][fptr]
, strlen((char*)ooii_cmenus[ooii_mode - 1][fptr]) - 1
, strlen((char *)ooii_cmenus[ooii_mode - 1][fptr]) - 1
, NULL
, 0
, NULL);
......@@ -275,7 +275,7 @@ readInPix(char codeCh, int ooii_mode)
else if ((codeCh >= 'F') && (codeCh <= 'K')) {
cterm_write(cterm
, ooii_bmenus[ooii_mode - 1][fptr]
, strlen((char*)ooii_bmenus[ooii_mode - 1][fptr]) - 1
, strlen((char *)ooii_bmenus[ooii_mode - 1][fptr]) - 1
, NULL
, 0
, NULL);
......@@ -283,7 +283,7 @@ readInPix(char codeCh, int ooii_mode)
else if (codeCh == '0') {
cterm_write(cterm
, ooii_logon[ooii_mode - 1][fptr]
, strlen((char*)ooii_logon[ooii_mode - 1][fptr]) - 1
, strlen((char *)ooii_logon[ooii_mode - 1][fptr]) - 1
, NULL
, 0
, NULL);
......@@ -298,9 +298,9 @@ readInPix(char codeCh, int ooii_mode)
}
static int
readInText(unsigned char*codeStr)
readInText(unsigned char *codeStr)
{
unsigned char*origCodeStr = codeStr;
unsigned char *origCodeStr = codeStr;
switch ((char)codeStr[0]) {
case '1':
......@@ -376,7 +376,7 @@ readInText(unsigned char*codeStr)
}
static void
getBlock(unsigned char**codeStr, char*menuBlock)
getBlock(unsigned char **codeStr, char *menuBlock)
{
menuBlock[0] = 0;
if (**codeStr == '_')
......@@ -388,7 +388,7 @@ getBlock(unsigned char**codeStr, char*menuBlock)
}
static void
strljust(char*buf, size_t len, char pad)
strljust(char *buf, size_t len, char pad)
{
size_t buflen = strlen(buf);
......@@ -399,7 +399,7 @@ strljust(char*buf, size_t len, char pad)
}
static void
strrjust(char*buf, size_t len, char pad)
strrjust(char *buf, size_t len, char pad)
{
size_t buflen = strlen(buf);
......@@ -410,26 +410,26 @@ strrjust(char*buf, size_t len, char pad)
}
static int
readSmallMenu(unsigned char*codeStr)
readSmallMenu(unsigned char *codeStr)
{
#define MultA 2
#define MultE 3
#define MultS 3
#define MultW 2
long aPrice[5] = {0, 4500, 14500, 29000, 42500};
long ePrice[13] = {0, 50, 200, 300, 500, 800, 1000, 1500, 1750, 2000, 3000, 5000, 15000};
long sPrice[3] = {0, 4500, 13500};
long wPrice[15] = {
long aPrice[5] = {0, 4500, 14500, 29000, 42500};
long ePrice[13] = {0, 50, 200, 300, 500, 800, 1000, 1500, 1750, 2000, 3000, 5000, 15000};
long sPrice[3] = {0, 4500, 13500};
long wPrice[15] = {
0, 700, 4250, 9500, 18000, 32500, 55750, 0, 7500, 12000, 19250, 30500, 41000, 64750, 0
};
char tempBlock[255];
char menuBlock[255];
int yy;
int zz;
unsigned char*origCodeStr = codeStr;
char buf[266];
char tempBlock[255];
char menuBlock[255];
int yy;
int zz;
unsigned char *origCodeStr = codeStr;
char buf[266];
switch ((char)codeStr[0]) {
case 'a':
......@@ -1163,11 +1163,11 @@ checkStamp(int xx, int yy, char stampStr[20]) // used w/ incomingCheck
}
static int
incomingCheckStatus(unsigned char*codeStr)
incomingCheckStatus(unsigned char *codeStr)
{
int who, zz;
char menuBlock[255];
unsigned char*origCodeStr = codeStr;
int who, zz;
char menuBlock[255];
unsigned char *origCodeStr = codeStr;
term_clearscreen();
term_gotoxy(1, 1);
......@@ -1268,7 +1268,7 @@ incomingCheckStatus(unsigned char*codeStr)
return codeStr - origCodeStr;
}
char*
char *
scanChar(unsigned char s, int where, int miniTrik)
{
if (!miniTrik) {
......@@ -1339,8 +1339,8 @@ scanChar(unsigned char s, int where, int miniTrik)
case 29:
return "@@ ";
case 30: {
time_t timer = time(NULL);
struct tm*tblock = localtime(&timer);
time_t timer = time(NULL);
struct tm *tblock = localtime(&timer);
switch (tblock->tm_wday) {
// 0 : no storms on Sunday!
......@@ -1467,15 +1467,15 @@ setScanCol(char s)
}
static int
incomingMapScanner(unsigned char*codeStr)
incomingMapScanner(unsigned char *codeStr)
{
int zz, scanPtr, yy;
unsigned char scanVals[10]; // ScanVals : ARRAY[1..9] OF BYTE;
char scan[30];
char menuBlock[255];
unsigned char*origCodeStr = codeStr;
int where;
int miniTrik;
int zz, scanPtr, yy;
unsigned char scanVals[10]; // ScanVals : ARRAY[1..9] OF BYTE;
char scan[30];
char menuBlock[255];
unsigned char *origCodeStr = codeStr;
int where;
int miniTrik;
codeStr++;
......@@ -1645,8 +1645,8 @@ incomingMapScanner(unsigned char*codeStr)
if (scanVals[zz] == 30) {
/* TODO: timer/tblock were not declared... */
time_t timer = time(NULL);
struct tm*tblock = localtime(&timer);
time_t timer = time(NULL);
struct tm *tblock = localtime(&timer);
term_setattr(stormColors[tblock->tm_wday]);
}
......@@ -2034,9 +2034,9 @@ incomingMapScanner(unsigned char*codeStr)
/* TODO: Sound support */
static int
incomingSoundVoc(unsigned char*codeStr)
incomingSoundVoc(unsigned char *codeStr)
{
unsigned char*origCodeStr = codeStr;
unsigned char *origCodeStr = codeStr;
codeStr++;
switch (*codeStr) {
......@@ -2183,7 +2183,7 @@ incomingSoundVoc(unsigned char*codeStr)
}
bool
handle_ooii_code(unsigned char*codeStr, int*ooii_mode, unsigned char*retbuf, size_t retsize)
handle_ooii_code(unsigned char *codeStr, int *ooii_mode, unsigned char *retbuf, size_t retsize)
{
bool quit = false;
char menuBlock[255];
......@@ -2238,8 +2238,8 @@ handle_ooii_code(unsigned char*codeStr, int*ooii_mode, unsigned char*retbuf, siz
if (zz < 1)
zz = 1;
*ooii_mode = zz + 1;
if (strlen((char*)retbuf) + 3 < retsize)
sprintf((char*)retbuf, "\xaf%d|", zz);
if (strlen((char *)retbuf) + 3 < retsize)
sprintf((char *)retbuf, "\xaf%d|", zz);
}
break;
}
......
......@@ -4,6 +4,6 @@
#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
#ifndef _BMENUS_H_
#define _BMENUS_H_
extern const unsigned char*ooii_bmenus[3][6];
extern const unsigned char *ooii_bmenus[3][6];
#endif
#ifndef _CMENUS_H_
#define _CMENUS_H_
extern const unsigned char*ooii_cmenus[3][5];
extern const unsigned char *ooii_cmenus[3][5];
#endif
#ifndef _LOGON_H_
#define _LOGON_H_
extern const unsigned char*ooii_logon[3][10];
extern const unsigned char *ooii_logon[3][10];
#endif
This diff is collapsed.