Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commits (1)
......@@ -1019,7 +1019,7 @@ void ansi_suspend(void)
#endif
}
CIOLIBEXPORT void CIOLIBCALL ansi_ciolib_setdoorway(int enable)
CIOLIBEXPORT void ansi_ciolib_setdoorway(int enable)
{
if(cio_api.mode!=CIOLIB_MODE_ANSI)
return;
......
This diff is collapsed.
......@@ -46,11 +46,6 @@
#endif
#ifdef _WIN32
#ifdef __BORLANDC__
#define CIOLIBCALL
#else
#define CIOLIBCALL
#endif
#if defined(CIOLIB_IMPORTS) || defined(CIOLIB_EXPORTS)
#if defined(CIOLIB_IMPORTS)
#define CIOLIBEXPORT __declspec( dllimport )
......@@ -64,11 +59,9 @@
#define CIOLIBEXPORTVAR extern
#endif
#elif defined __unix__
#define CIOLIBCALL
#define CIOLIBEXPORT
#define CIOLIBEXPORTVAR extern
#else
#define CIOLIBCALL
#define CIOLIBEXPORT
#define CIOLIBEXPORTVAR extern
#endif
......@@ -399,86 +392,86 @@ CIOLIBEXPORTVAR int ciolib_initial_window_width;
#ifdef __cplusplus
extern "C" {
#endif
CIOLIBEXPORT int CIOLIBCALL initciolib(int mode);
CIOLIBEXPORT void CIOLIBCALL suspendciolib(void);
CIOLIBEXPORT int CIOLIBCALL ciolib_movetext(int sx, int sy, int ex, int ey, int dx, int dy);
CIOLIBEXPORT char * CIOLIBCALL ciolib_cgets(char *str);
CIOLIBEXPORT int CIOLIBCALL ciolib_cscanf (char *format , ...);
CIOLIBEXPORT int CIOLIBCALL ciolib_kbhit(void);
CIOLIBEXPORT int CIOLIBCALL ciolib_getch(void);
CIOLIBEXPORT int CIOLIBCALL ciolib_getche(void);
CIOLIBEXPORT int CIOLIBCALL ciolib_ungetch(int ch);
CIOLIBEXPORT void CIOLIBCALL ciolib_gettextinfo(struct text_info *info);
CIOLIBEXPORT int CIOLIBCALL ciolib_wherex(void);
CIOLIBEXPORT int CIOLIBCALL ciolib_wherey(void);
CIOLIBEXPORT void CIOLIBCALL ciolib_wscroll(void);
CIOLIBEXPORT void CIOLIBCALL ciolib_gotoxy(int x, int y);
CIOLIBEXPORT void CIOLIBCALL ciolib_clreol(void);
CIOLIBEXPORT void CIOLIBCALL ciolib_clrscr(void);
CIOLIBEXPORT int CIOLIBCALL ciolib_cputs(char *str);
CIOLIBEXPORT int CIOLIBCALL ciolib_cprintf(const char *fmat, ...);
CIOLIBEXPORT void CIOLIBCALL ciolib_textbackground(int colour);
CIOLIBEXPORT void CIOLIBCALL ciolib_textcolor(int colour);
CIOLIBEXPORT void CIOLIBCALL ciolib_highvideo(void);
CIOLIBEXPORT void CIOLIBCALL ciolib_lowvideo(void);
CIOLIBEXPORT void CIOLIBCALL ciolib_normvideo(void);
CIOLIBEXPORT int CIOLIBCALL ciolib_puttext(int a,int b,int c,int d,void *e);
CIOLIBEXPORT int CIOLIBCALL ciolib_vmem_puttext(int a,int b,int c,int d,struct vmem_cell *e);
CIOLIBEXPORT int CIOLIBCALL ciolib_gettext(int a,int b,int c,int d,void *e);
CIOLIBEXPORT int CIOLIBCALL ciolib_vmem_gettext(int a,int b,int c,int d,struct vmem_cell *e);
CIOLIBEXPORT void CIOLIBCALL ciolib_textattr(int a);
CIOLIBEXPORT void CIOLIBCALL ciolib_delay(long a);
CIOLIBEXPORT int CIOLIBCALL ciolib_putch(int a);
CIOLIBEXPORT void CIOLIBCALL ciolib_setcursortype(int a);
CIOLIBEXPORT void CIOLIBCALL ciolib_textmode(int mode);
CIOLIBEXPORT void CIOLIBCALL ciolib_window(int sx, int sy, int ex, int ey);
CIOLIBEXPORT void CIOLIBCALL ciolib_delline(void);
CIOLIBEXPORT void CIOLIBCALL ciolib_insline(void);
CIOLIBEXPORT char * CIOLIBCALL ciolib_getpass(const char *prompt);
CIOLIBEXPORT void CIOLIBCALL ciolib_settitle(const char *title);
CIOLIBEXPORT void CIOLIBCALL ciolib_setname(const char *title);
CIOLIBEXPORT void CIOLIBCALL ciolib_seticon(const void *icon,unsigned long size);
CIOLIBEXPORT int CIOLIBCALL ciolib_showmouse(void);
CIOLIBEXPORT int CIOLIBCALL ciolib_hidemouse(void);
CIOLIBEXPORT int CIOLIBCALL ciolib_mousepointeer(enum ciolib_mouse_ptr);
CIOLIBEXPORT void CIOLIBCALL ciolib_copytext(const char *text, size_t buflen);
CIOLIBEXPORT char * CIOLIBCALL ciolib_getcliptext(void);
CIOLIBEXPORT int CIOLIBCALL ciolib_setfont(int font, int force, int font_num);
CIOLIBEXPORT int CIOLIBCALL ciolib_getfont(int font_num);
CIOLIBEXPORT int CIOLIBCALL ciolib_loadfont(char *filename);
CIOLIBEXPORT int CIOLIBCALL ciolib_get_window_info(int *width, int *height, int *xpos, int *ypos);
CIOLIBEXPORT void CIOLIBCALL ciolib_beep(void);
CIOLIBEXPORT void CIOLIBCALL ciolib_getcustomcursor(int *startline, int *endline, int *range, int *blink, int *visible);
CIOLIBEXPORT void CIOLIBCALL ciolib_setcustomcursor(int startline, int endline, int range, int blink, int visible);
CIOLIBEXPORT void CIOLIBCALL ciolib_setvideoflags(int flags);
CIOLIBEXPORT int CIOLIBCALL ciolib_getvideoflags(void);
CIOLIBEXPORT void CIOLIBCALL ciolib_setscaling(int flags);
CIOLIBEXPORT int CIOLIBCALL ciolib_getscaling(void);
CIOLIBEXPORT int CIOLIBCALL ciolib_setpalette(uint32_t entry, uint16_t r, uint16_t g, uint16_t b);
CIOLIBEXPORT int CIOLIBCALL ciolib_attr2palette(uint8_t attr, uint32_t *fg, uint32_t *bg);
CIOLIBEXPORT int CIOLIBCALL ciolib_setpixel(uint32_t x, uint32_t y, uint32_t colour);
CIOLIBEXPORT struct ciolib_pixels * CIOLIBCALL ciolib_getpixels(uint32_t sx, uint32_t sy, uint32_t ex, uint32_t ey, int force);
CIOLIBEXPORT int CIOLIBCALL ciolib_setpixels(uint32_t sx, uint32_t sy, uint32_t ex, uint32_t ey, uint32_t x_off, uint32_t y_off, struct ciolib_pixels *pixels, void *mask);
CIOLIBEXPORT void CIOLIBCALL ciolib_freepixels(struct ciolib_pixels *pixels);
CIOLIBEXPORT struct ciolib_screen * CIOLIBCALL ciolib_savescreen(void);
CIOLIBEXPORT void CIOLIBCALL ciolib_freescreen(struct ciolib_screen *);
CIOLIBEXPORT int CIOLIBCALL ciolib_restorescreen(struct ciolib_screen *scrn);
CIOLIBEXPORT void CIOLIBCALL ciolib_setcolour(uint32_t fg, uint32_t bg);
CIOLIBEXPORT int CIOLIBCALL ciolib_get_modepalette(uint32_t[16]);
CIOLIBEXPORT int CIOLIBCALL ciolib_set_modepalette(uint32_t[16]);
CIOLIBEXPORT uint32_t CIOLIBCALL ciolib_map_rgb(uint16_t r, uint16_t g, uint16_t b);
CIOLIBEXPORT void CIOLIBCALL ciolib_replace_font(uint8_t id, char *name, void *data, size_t size);
CIOLIBEXPORT int CIOLIBCALL ciolib_attrfont(uint8_t attr);
CIOLIBEXPORT int CIOLIBCALL ciolib_checkfont(int font_num);
CIOLIBEXPORT void CIOLIBCALL ciolib_set_vmem(struct vmem_cell *cell, uint8_t ch, uint8_t attr, uint8_t font);
CIOLIBEXPORT void CIOLIBCALL ciolib_set_vmem_attr(struct vmem_cell *cell, uint8_t attr);
CIOLIBEXPORT void CIOLIBCALL ciolib_setwinsize(int width, int height);
CIOLIBEXPORT void CIOLIBCALL ciolib_setwinposition(int x, int y);
CIOLIBEXPORT enum ciolib_codepage CIOLIBCALL ciolib_getcodepage(void);
CIOLIBEXPORT int initciolib(int mode);
CIOLIBEXPORT void suspendciolib(void);
CIOLIBEXPORT int ciolib_movetext(int sx, int sy, int ex, int ey, int dx, int dy);
CIOLIBEXPORT char * ciolib_cgets(char *str);
CIOLIBEXPORT int ciolib_cscanf (char *format , ...);
CIOLIBEXPORT int ciolib_kbhit(void);
CIOLIBEXPORT int ciolib_getch(void);
CIOLIBEXPORT int ciolib_getche(void);
CIOLIBEXPORT int ciolib_ungetch(int ch);
CIOLIBEXPORT void ciolib_gettextinfo(struct text_info *info);
CIOLIBEXPORT int ciolib_wherex(void);
CIOLIBEXPORT int ciolib_wherey(void);
CIOLIBEXPORT void ciolib_wscroll(void);
CIOLIBEXPORT void ciolib_gotoxy(int x, int y);
CIOLIBEXPORT void ciolib_clreol(void);
CIOLIBEXPORT void ciolib_clrscr(void);
CIOLIBEXPORT int ciolib_cputs(char *str);
CIOLIBEXPORT int ciolib_cprintf(const char *fmat, ...);
CIOLIBEXPORT void ciolib_textbackground(int colour);
CIOLIBEXPORT void ciolib_textcolor(int colour);
CIOLIBEXPORT void ciolib_highvideo(void);
CIOLIBEXPORT void ciolib_lowvideo(void);
CIOLIBEXPORT void ciolib_normvideo(void);
CIOLIBEXPORT int ciolib_puttext(int a,int b,int c,int d,void *e);
CIOLIBEXPORT int ciolib_vmem_puttext(int a,int b,int c,int d,struct vmem_cell *e);
CIOLIBEXPORT int ciolib_gettext(int a,int b,int c,int d,void *e);
CIOLIBEXPORT int ciolib_vmem_gettext(int a,int b,int c,int d,struct vmem_cell *e);
CIOLIBEXPORT void ciolib_textattr(int a);
CIOLIBEXPORT void ciolib_delay(long a);
CIOLIBEXPORT int ciolib_putch(int a);
CIOLIBEXPORT void ciolib_setcursortype(int a);
CIOLIBEXPORT void ciolib_textmode(int mode);
CIOLIBEXPORT void ciolib_window(int sx, int sy, int ex, int ey);
CIOLIBEXPORT void ciolib_delline(void);
CIOLIBEXPORT void ciolib_insline(void);
CIOLIBEXPORT char * ciolib_getpass(const char *prompt);
CIOLIBEXPORT void ciolib_settitle(const char *title);
CIOLIBEXPORT void ciolib_setname(const char *title);
CIOLIBEXPORT void ciolib_seticon(const void *icon,unsigned long size);
CIOLIBEXPORT int ciolib_showmouse(void);
CIOLIBEXPORT int ciolib_hidemouse(void);
CIOLIBEXPORT int ciolib_mousepointeer(enum ciolib_mouse_ptr);
CIOLIBEXPORT void ciolib_copytext(const char *text, size_t buflen);
CIOLIBEXPORT char * ciolib_getcliptext(void);
CIOLIBEXPORT int ciolib_setfont(int font, int force, int font_num);
CIOLIBEXPORT int ciolib_getfont(int font_num);
CIOLIBEXPORT int ciolib_loadfont(char *filename);
CIOLIBEXPORT int ciolib_get_window_info(int *width, int *height, int *xpos, int *ypos);
CIOLIBEXPORT void ciolib_beep(void);
CIOLIBEXPORT void ciolib_getcustomcursor(int *startline, int *endline, int *range, int *blink, int *visible);
CIOLIBEXPORT void ciolib_setcustomcursor(int startline, int endline, int range, int blink, int visible);
CIOLIBEXPORT void ciolib_setvideoflags(int flags);
CIOLIBEXPORT int ciolib_getvideoflags(void);
CIOLIBEXPORT void ciolib_setscaling(int flags);
CIOLIBEXPORT int ciolib_getscaling(void);
CIOLIBEXPORT int ciolib_setpalette(uint32_t entry, uint16_t r, uint16_t g, uint16_t b);
CIOLIBEXPORT int ciolib_attr2palette(uint8_t attr, uint32_t *fg, uint32_t *bg);
CIOLIBEXPORT int ciolib_setpixel(uint32_t x, uint32_t y, uint32_t colour);
CIOLIBEXPORT struct ciolib_pixels * ciolib_getpixels(uint32_t sx, uint32_t sy, uint32_t ex, uint32_t ey, int force);
CIOLIBEXPORT int ciolib_setpixels(uint32_t sx, uint32_t sy, uint32_t ex, uint32_t ey, uint32_t x_off, uint32_t y_off, struct ciolib_pixels *pixels, void *mask);
CIOLIBEXPORT void ciolib_freepixels(struct ciolib_pixels *pixels);
CIOLIBEXPORT struct ciolib_screen * ciolib_savescreen(void);
CIOLIBEXPORT void ciolib_freescreen(struct ciolib_screen *);
CIOLIBEXPORT int ciolib_restorescreen(struct ciolib_screen *scrn);
CIOLIBEXPORT void ciolib_setcolour(uint32_t fg, uint32_t bg);
CIOLIBEXPORT int ciolib_get_modepalette(uint32_t[16]);
CIOLIBEXPORT int ciolib_set_modepalette(uint32_t[16]);
CIOLIBEXPORT uint32_t ciolib_map_rgb(uint16_t r, uint16_t g, uint16_t b);
CIOLIBEXPORT void ciolib_replace_font(uint8_t id, char *name, void *data, size_t size);
CIOLIBEXPORT int ciolib_attrfont(uint8_t attr);
CIOLIBEXPORT int ciolib_checkfont(int font_num);
CIOLIBEXPORT void ciolib_set_vmem(struct vmem_cell *cell, uint8_t ch, uint8_t attr, uint8_t font);
CIOLIBEXPORT void ciolib_set_vmem_attr(struct vmem_cell *cell, uint8_t attr);
CIOLIBEXPORT void ciolib_setwinsize(int width, int height);
CIOLIBEXPORT void ciolib_setwinposition(int x, int y);
CIOLIBEXPORT enum ciolib_codepage ciolib_getcodepage(void);
/* DoorWay specific stuff that's only applicable to ANSI mode. */
CIOLIBEXPORT void CIOLIBCALL ansi_ciolib_setdoorway(int enable);
CIOLIBEXPORT void ansi_ciolib_setdoorway(int enable);
#ifdef __cplusplus
}
#endif
......@@ -657,21 +650,21 @@ extern int ciolib_mouse_initialized;
#ifdef __cplusplus
extern "C" {
#endif
CIOLIBEXPORT void CIOLIBCALL ciomouse_gotevent(int event, int x, int y, int x_res, int y_res);
CIOLIBEXPORT int CIOLIBCALL mouse_trywait(void);
CIOLIBEXPORT int CIOLIBCALL mouse_wait(void);
CIOLIBEXPORT int CIOLIBCALL mouse_pending(void);
CIOLIBEXPORT int CIOLIBCALL ciolib_getmouse(struct mouse_event *mevent);
CIOLIBEXPORT int CIOLIBCALL ciolib_ungetmouse(struct mouse_event *mevent);
CIOLIBEXPORT void ciomouse_gotevent(int event, int x, int y, int x_res, int y_res);
CIOLIBEXPORT int mouse_trywait(void);
CIOLIBEXPORT int mouse_wait(void);
CIOLIBEXPORT int mouse_pending(void);
CIOLIBEXPORT int ciolib_getmouse(struct mouse_event *mevent);
CIOLIBEXPORT int ciolib_ungetmouse(struct mouse_event *mevent);
CIOLIBEXPORT void ciolib_mouse_thread(void *data);
CIOLIBEXPORT uint64_t CIOLIBCALL ciomouse_setevents(uint64_t events);
CIOLIBEXPORT uint64_t CIOLIBCALL ciomouse_addevents(uint64_t events);
CIOLIBEXPORT uint64_t CIOLIBCALL ciomouse_delevents(uint64_t events);
CIOLIBEXPORT uint64_t CIOLIBCALL ciomouse_addevent(uint64_t event);
CIOLIBEXPORT uint64_t CIOLIBCALL ciomouse_delevent(uint64_t event);
CIOLIBEXPORT uint32_t CIOLIBCALL ciolib_mousepointer(enum ciolib_mouse_ptr type);
CIOLIBEXPORT void CIOLIBCALL mousestate(int *x, int *y, uint8_t *buttons);
CIOLIBEXPORT void CIOLIBCALL mousestate_res(int *x_res, int *y_res, uint8_t *buttons);
CIOLIBEXPORT uint64_t ciomouse_setevents(uint64_t events);
CIOLIBEXPORT uint64_t ciomouse_addevents(uint64_t events);
CIOLIBEXPORT uint64_t ciomouse_delevents(uint64_t events);
CIOLIBEXPORT uint64_t ciomouse_addevent(uint64_t event);
CIOLIBEXPORT uint64_t ciomouse_delevent(uint64_t event);
CIOLIBEXPORT uint32_t ciolib_mousepointer(enum ciolib_mouse_ptr type);
CIOLIBEXPORT void mousestate(int *x, int *y, uint8_t *buttons);
CIOLIBEXPORT void mousestate_res(int *x_res, int *y_res, uint8_t *buttons);
#ifdef __cplusplus
}
#endif
......
......@@ -1270,7 +1270,7 @@ clear2bol(struct cterminal * cterm)
free(buf);
}
void CIOLIBCALL
void
cterm_clearscreen(struct cterminal *cterm, char attr)
{
int getw;
......@@ -4389,7 +4389,7 @@ cterm_reset(struct cterminal *cterm)
}
}
struct cterminal* CIOLIBCALL cterm_init(int height, int width, int xpos, int ypos, int backlines, int backcols, struct vmem_cell *scrollback, int emulation)
struct cterminal* cterm_init(int height, int width, int xpos, int ypos, int backlines, int backcols, struct vmem_cell *scrollback, int emulation)
{
char *revision="$Revision: 1.314 $";
char *in;
......@@ -4461,7 +4461,7 @@ struct cterminal* CIOLIBCALL cterm_init(int height, int width, int xpos, int ypo
return cterm;
}
void CIOLIBCALL cterm_start(struct cterminal *cterm)
void cterm_start(struct cterminal *cterm)
{
struct text_info ti;
......@@ -4758,7 +4758,7 @@ static void parse_macro_intro(struct cterminal *cterm)
#define uctputs(c, p) ctputs(c, (char *)p)
#define ustrcat(b, s) strcat((char *)b, (const char *)s)
CIOLIBEXPORT char* CIOLIBCALL cterm_write(struct cterminal * cterm, const void *vbuf, int buflen, char *retbuf, size_t retsize, int *speed)
CIOLIBEXPORT char* cterm_write(struct cterminal * cterm, const void *vbuf, int buflen, char *retbuf, size_t retsize, int *speed)
{
const unsigned char *buf = (unsigned char *)vbuf;
unsigned char ch[2];
......@@ -5541,7 +5541,7 @@ CIOLIBEXPORT char* CIOLIBCALL cterm_write(struct cterminal * cterm, const void *
return(retbuf);
}
int CIOLIBCALL cterm_openlog(struct cterminal *cterm, char *logfile, int logtype)
int cterm_openlog(struct cterminal *cterm, char *logfile, int logtype)
{
if(!cterm->started)
cterm_start(cterm);
......@@ -5553,7 +5553,7 @@ int CIOLIBCALL cterm_openlog(struct cterminal *cterm, char *logfile, int logtype
return(1);
}
void CIOLIBCALL cterm_closelog(struct cterminal *cterm)
void cterm_closelog(struct cterminal *cterm)
{
if(!cterm->started)
cterm_start(cterm);
......@@ -5565,7 +5565,7 @@ void CIOLIBCALL cterm_closelog(struct cterminal *cterm)
}
FILE *dbg;
void CIOLIBCALL cterm_end(struct cterminal *cterm)
void cterm_end(struct cterminal *cterm)
{
int i;
......
......@@ -241,27 +241,27 @@ struct cterminal {
int (*ciolib_cputs) (struct cterminal *,char *);
int (*ciolib_setfont) (struct cterminal *,int font, int force, int font_num);
#else
void CIOLIBCALL (*ciolib_gotoxy) (int,int);
int CIOLIBCALL (*ciolib_wherex) (void);
int CIOLIBCALL (*ciolib_wherey) (void);
int CIOLIBCALL (*ciolib_gettext) (int,int,int,int,void *);
int CIOLIBCALL (*ciolib_vmem_gettext) (int,int,int,int,struct vmem_cell *);
void CIOLIBCALL (*ciolib_gettextinfo) (struct text_info *);
void CIOLIBCALL (*ciolib_textattr) (int);
void CIOLIBCALL (*ciolib_setcursortype) (int);
int CIOLIBCALL (*ciolib_movetext) (int,int,int,int,int,int);
void CIOLIBCALL (*ciolib_clreol) (void);
void CIOLIBCALL (*ciolib_clrscr) (void);
void CIOLIBCALL (*ciolib_setvideoflags) (int flags);
int CIOLIBCALL (*ciolib_getvideoflags) (void);
void CIOLIBCALL (*ciolib_setscaling) (int new_value);
int CIOLIBCALL (*ciolib_getscaling) (void);
int CIOLIBCALL (*ciolib_putch) (int);
int CIOLIBCALL (*ciolib_puttext) (int,int,int,int,void *);
int CIOLIBCALL (*ciolib_vmem_puttext) (int,int,int,int,struct vmem_cell *);
void CIOLIBCALL (*ciolib_window) (int,int,int,int);
int CIOLIBCALL (*ciolib_cputs) (char *);
int CIOLIBCALL (*ciolib_setfont) (int font, int force, int font_num);
void (*ciolib_gotoxy) (int,int);
int (*ciolib_wherex) (void);
int (*ciolib_wherey) (void);
int (*ciolib_gettext) (int,int,int,int,void *);
int (*ciolib_vmem_gettext) (int,int,int,int,struct vmem_cell *);
void (*ciolib_gettextinfo) (struct text_info *);
void (*ciolib_textattr) (int);
void (*ciolib_setcursortype) (int);
int (*ciolib_movetext) (int,int,int,int,int,int);
void (*ciolib_clreol) (void);
void (*ciolib_clrscr) (void);
void (*ciolib_setvideoflags) (int flags);
int (*ciolib_getvideoflags) (void);
void (*ciolib_setscaling) (int new_value);
int (*ciolib_getscaling) (void);
int (*ciolib_putch) (int);
int (*ciolib_puttext) (int,int,int,int,void *);
int (*ciolib_vmem_puttext) (int,int,int,int,struct vmem_cell *);
void (*ciolib_window) (int,int,int,int);
int (*ciolib_cputs) (char *);
int (*ciolib_setfont) (int font, int force, int font_num);
#endif
int *_wscroll;
int *puttext_can_move;
......@@ -273,13 +273,13 @@ struct cterminal {
extern "C" {
#endif
CIOLIBEXPORT struct cterminal* CIOLIBCALL cterm_init(int height, int width, int xpos, int ypos, int backlines, int backcols, struct vmem_cell *scrollback, int emulation);
CIOLIBEXPORT char* CIOLIBCALL cterm_write(struct cterminal *cterm, const void *buf, int buflen, char *retbuf, size_t retsize, int *speed);
CIOLIBEXPORT int CIOLIBCALL cterm_openlog(struct cterminal *cterm, char *logfile, int logtype);
CIOLIBEXPORT void CIOLIBCALL cterm_closelog(struct cterminal *cterm);
CIOLIBEXPORT void CIOLIBCALL cterm_end(struct cterminal *cterm);
CIOLIBEXPORT void CIOLIBCALL cterm_clearscreen(struct cterminal *cterm, char attr);
CIOLIBEXPORT void CIOLIBCALL cterm_start(struct cterminal *cterm);
CIOLIBEXPORT struct cterminal* cterm_init(int height, int width, int xpos, int ypos, int backlines, int backcols, struct vmem_cell *scrollback, int emulation);
CIOLIBEXPORT char* cterm_write(struct cterminal *cterm, const void *buf, int buflen, char *retbuf, size_t retsize, int *speed);
CIOLIBEXPORT int cterm_openlog(struct cterminal *cterm, char *logfile, int logtype);
CIOLIBEXPORT void cterm_closelog(struct cterminal *cterm);
CIOLIBEXPORT void cterm_end(struct cterminal *cterm);
CIOLIBEXPORT void cterm_clearscreen(struct cterminal *cterm, char attr);
CIOLIBEXPORT void cterm_start(struct cterminal *cterm);
void cterm_gotoxy(struct cterminal *cterm, int x, int y);
void setwindow(struct cterminal *cterm);
void cterm_clreol(struct cterminal *cterm);
......
......@@ -110,7 +110,7 @@ int ciolib_mouse_initialized=0;
static int ungot=0;
pthread_mutex_t unget_mutex;
void CIOLIBCALL init_mouse(void)
void init_mouse(void)
{
memset(&state,0,sizeof(state));
state.click_timeout=0;
......@@ -121,7 +121,7 @@ void CIOLIBCALL init_mouse(void)
ciolib_mouse_initialized=1;
}
void CIOLIBCALL mousestate(int *x, int *y, uint8_t *buttons)
void mousestate(int *x, int *y, uint8_t *buttons)
{
if (!ciolib_mouse_initialized) {
if (x)
......@@ -139,7 +139,7 @@ void CIOLIBCALL mousestate(int *x, int *y, uint8_t *buttons)
return;
}
void CIOLIBCALL mousestate_res(int *x, int *y, uint8_t *buttons)
void mousestate_res(int *x, int *y, uint8_t *buttons)
{
if (!ciolib_mouse_initialized) {
if (x)
......@@ -157,37 +157,37 @@ void CIOLIBCALL mousestate_res(int *x, int *y, uint8_t *buttons)
return;
}
uint64_t CIOLIBCALL ciomouse_setevents(uint64_t events)
uint64_t ciomouse_setevents(uint64_t events)
{
mouse_events=events;
return mouse_events;
}
uint64_t CIOLIBCALL ciomouse_addevents(uint64_t events)
uint64_t ciomouse_addevents(uint64_t events)
{
mouse_events |= events;
return mouse_events;
}
uint64_t CIOLIBCALL ciomouse_delevents(uint64_t events)
uint64_t ciomouse_delevents(uint64_t events)
{
mouse_events &= ~events;
return mouse_events;
}
uint64_t CIOLIBCALL ciomouse_addevent(uint64_t event)
uint64_t ciomouse_addevent(uint64_t event)
{
mouse_events |= (UINT64_C(1)<<event);
return mouse_events;
}
uint64_t CIOLIBCALL ciomouse_delevent(uint64_t event)
uint64_t ciomouse_delevent(uint64_t event)
{
mouse_events &= ~(UINT64_C(1)<<event);
return mouse_events;
}
void CIOLIBCALL ciomouse_gotevent(int event, int x, int y, int x_res, int y_res)
void ciomouse_gotevent(int event, int x, int y, int x_res, int y_res)
{
struct in_mouse_event *ime;
......@@ -207,7 +207,7 @@ void CIOLIBCALL ciomouse_gotevent(int event, int x, int y, int x_res, int y_res)
}
}
void CIOLIBCALL add_outevent(int event, int x, int y, int xres, int yres)
void add_outevent(int event, int x, int y, int xres, int yres)
{
struct out_mouse_event *ome;
int but;
......@@ -236,7 +236,7 @@ void CIOLIBCALL add_outevent(int event, int x, int y, int xres, int yres)
}
}
int CIOLIBCALL more_multies(int button, int clicks)
int more_multies(int button, int clicks)
{
switch(clicks) {
case 0:
......@@ -516,7 +516,7 @@ void ciolib_mouse_thread(void *data)
}
}
int CIOLIBCALL mouse_trywait(void)
int mouse_trywait(void)
{
int result;
......@@ -534,7 +534,7 @@ int CIOLIBCALL mouse_trywait(void)
}
}
int CIOLIBCALL mouse_wait(void)
int mouse_wait(void)
{
int result;
......@@ -552,14 +552,14 @@ int CIOLIBCALL mouse_wait(void)
}
}
int CIOLIBCALL mouse_pending(void)
int mouse_pending(void)
{
while(!ciolib_mouse_initialized)
SLEEP(1);
return(listCountNodes(&state.output));
}
int CIOLIBCALL ciolib_getmouse(struct mouse_event *mevent)
int ciolib_getmouse(struct mouse_event *mevent)
{
int retval=0;
......@@ -594,7 +594,7 @@ int CIOLIBCALL ciolib_getmouse(struct mouse_event *mevent)
return(retval);
}
int CIOLIBCALL ciolib_ungetmouse(struct mouse_event *mevent)
int ciolib_ungetmouse(struct mouse_event *mevent)
{
struct mouse_event *me;
......
......@@ -42,25 +42,19 @@
#else
#define B64EXPORT __declspec(dllexport)
#endif
#if defined(__BORLANDC__)
#define B64CALL
#else
#define B64CALL
#endif
#else /* !_WIN32 */
#define B64EXPORT
#define B64CALL
#endif
#ifdef __cplusplus
extern "C" {
#endif
B64EXPORT int B64CALL b64_encode(char *target, size_t tlen, const char *source, size_t slen);
B64EXPORT int B64CALL b64_decode(char *target, size_t tlen, const char *source, size_t slen);
B64EXPORT int b64_encode(char *target, size_t tlen, const char *source, size_t slen);
B64EXPORT int b64_decode(char *target, size_t tlen, const char *source, size_t slen);
#ifdef __cplusplus
}
#endif
#endif /* Don't add anything after this line */
\ No newline at end of file
#endif /* Don't add anything after this line */
......@@ -558,7 +558,7 @@ static short int lzh_decode_position(lzh_t* lzh, uint8_t *inbuf, int32_t *incnt,
/* Encoding/Compressing */
/* Returns length of outbuf */
int32_t LZHCALL lzh_encode(uint8_t *inbuf, int32_t inlen, uint8_t *outbuf)
int32_t lzh_encode(uint8_t *inbuf, int32_t inlen, uint8_t *outbuf)
{
short int i, c, len, r, s, last_match_length;
int32_t incnt,outlen; /* textsize=0; */
......@@ -688,7 +688,7 @@ int32_t LZHCALL lzh_encode(uint8_t *inbuf, int32_t inlen, uint8_t *outbuf)
/* Decoding/Uncompressing */
/* Returns length of outbuf */
int32_t LZHCALL lzh_decode(uint8_t *inbuf, int32_t inlen, uint8_t *outbuf)
int32_t lzh_decode(uint8_t *inbuf, int32_t inlen, uint8_t *outbuf)
{
short int i, j, k, r, c;
uint32_t count;
......
/* lzh.h */
/* Synchronet LZH compression library */
/* $Id: lzh.h,v 1.13 2019/03/22 21:29:12 rswindell Exp $ */
/****************************************************************************
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
......@@ -16,18 +12,6 @@
* Anonymous FTP access to the most recent released source is available at *
* ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net *
* *
* Anonymous CVS access to the development source and modification history *
* is available at cvs.synchro.net:/cvsroot/sbbs, example: *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login *
* (just hit return, no password is necessary) *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src *
* *
* For Synchronet coding style and modification guidelines, see *
* http://www.synchro.net/source.html *
* *
* You are encouraged to submit any modifications (preferably in Unix diff *
* format) via e-mail to mods@synchro.net *
* *
* Note: If this box doesn't appear square, then you need to fix your tabs. *
****************************************************************************/
......@@ -39,11 +23,6 @@
#endif
#ifdef _WIN32
#ifdef __BORLANDC__
#define LZHCALL
#else
#define LZHCALL
#endif
#ifdef LZHDLL /* LZH functions in DLL */
#ifdef LZH_EXPORTS
#define LZHEXPORT __declspec( dllexport )
......@@ -54,7 +33,6 @@
#define LZHEXPORT
#endif
#else /* !_WIN32 */
#define LZHCALL
#define LZHEXPORT
#endif
......@@ -63,8 +41,8 @@
#ifdef __cplusplus
extern "C" {
#endif
LZHEXPORT int32_t LZHCALL lzh_encode(uint8_t *inbuf, int32_t inlen, uint8_t *outbuf);
LZHEXPORT int32_t LZHCALL lzh_decode(uint8_t *inbuf, int32_t inlen, uint8_t *outbuf);
LZHEXPORT int32_t lzh_encode(uint8_t *inbuf, int32_t inlen, uint8_t *outbuf);
LZHEXPORT int32_t lzh_decode(uint8_t *inbuf, int32_t inlen, uint8_t *outbuf);
#ifdef __cplusplus
}
#endif
......
......@@ -139,9 +139,6 @@ static ini_bitdesc_t ftp_options[] = {
#ifdef DLLEXPORT
#undef DLLEXPORT
#endif
#ifdef DLLCALL
#undef DLLCALL
#endif
#ifdef _WIN32
#ifdef FTPSRVR_EXPORTS
......@@ -149,23 +146,17 @@ static ini_bitdesc_t ftp_options[] = {
#else
#define DLLEXPORT __declspec(dllimport)
#endif
#ifdef __BORLANDC__
#define DLLCALL
#else
#define DLLCALL
#endif
#else
#define DLLEXPORT
#define DLLCALL
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* arg is pointer to static ftp_startup_t */
DLLEXPORT void DLLCALL ftp_server(void* arg);
DLLEXPORT void DLLCALL ftp_terminate(void);
DLLEXPORT const char* DLLCALL ftp_ver(void);
DLLEXPORT void ftp_server(void* arg);
DLLEXPORT void ftp_terminate(void);
DLLEXPORT const char* ftp_ver(void);
#ifdef __cplusplus
}
#endif
......
......@@ -7,6 +7,6 @@ struct js_cryptcert_private_data {
extern JSClass js_cryptcert_class;
JSObject* DLLCALL js_CreateCryptCertObject(JSContext* cx, CRYPT_CERTIFICATE cert);
JSObject* js_CreateCryptCertObject(JSContext* cx, CRYPT_CERTIFICATE cert);
#endif
......@@ -7,6 +7,6 @@ struct js_cryptcon_private_data {
extern JSClass js_cryptcon_class;
JSObject* DLLCALL js_CreateCryptconObject(JSContext* cx, CRYPT_CONTEXT ctx);
JSObject* js_CreateCryptconObject(JSContext* cx, CRYPT_CONTEXT ctx);
#endif
......@@ -77,7 +77,7 @@
/****************************************************************************/
/* Returns 0 on success, non-zero on failure */
/****************************************************************************/
int RINGBUFCALL RingBufInit( RingBuf* rb, DWORD size
int RingBufInit( RingBuf* rb, DWORD size
#ifndef RINGBUF_USE_STD_RTL
,void *(os_malloc)(size_t)
,void (os_free)(void *)
......@@ -108,7 +108,7 @@ int RINGBUFCALL RingBufInit( RingBuf* rb, DWORD size
return(0);
}
void RINGBUFCALL RingBufDispose( RingBuf* rb)
void RingBufDispose( RingBuf* rb)
{
if(rb->pStart!=NULL)
os_free(rb->pStart);
......@@ -137,7 +137,7 @@ void RINGBUFCALL RingBufDispose( RingBuf* rb)
#define RINGBUF_FILL_LEVEL(rb) (rb->pHead >= rb->pTail ? (rb->pHead - rb->pTail) \
: (rb->size - (rb->pTail - (rb->pHead + 1))))
DWORD RINGBUFCALL RingBufFull( RingBuf* rb )
DWORD RingBufFull( RingBuf* rb )
{
DWORD retval;
......@@ -154,7 +154,7 @@ DWORD RINGBUFCALL RingBufFull( RingBuf* rb )
return(retval);
}
DWORD RINGBUFCALL RingBufFree( RingBuf* rb )
DWORD RingBufFree( RingBuf* rb )
{
DWORD retval;
......@@ -163,7 +163,7 @@ DWORD RINGBUFCALL RingBufFree( RingBuf* rb )
return(retval);
}
DWORD RINGBUFCALL RingBufWrite( RingBuf* rb, const BYTE* src, DWORD cnt )
DWORD RingBufWrite( RingBuf* rb, const BYTE* src, DWORD cnt )
{
DWORD max, first, remain, fill_level;
......@@ -224,7 +224,7 @@ DWORD RINGBUFCALL RingBufWrite( RingBuf* rb, const BYTE* src, DWORD cnt )
}
/* Pass NULL dst to just foward pointer (after Peek) */
DWORD RINGBUFCALL RingBufRead( RingBuf* rb, BYTE* dst, DWORD cnt )
DWORD RingBufRead( RingBuf* rb, BYTE* dst, DWORD cnt )
{
DWORD max, first, remain, len;
......@@ -284,7 +284,7 @@ DWORD RINGBUFCALL RingBufRead( RingBuf* rb, BYTE* dst, DWORD cnt )
return(cnt);
}
DWORD RINGBUFCALL RingBufPeek( RingBuf* rb, BYTE* dst, DWORD cnt)
DWORD RingBufPeek( RingBuf* rb, BYTE* dst, DWORD cnt)
{
DWORD max, first, remain, len;
......@@ -325,7 +325,7 @@ DWORD RINGBUFCALL RingBufPeek( RingBuf* rb, BYTE* dst, DWORD cnt)
}
/* Reset head and tail pointers */
void RINGBUFCALL RingBufReInit(RingBuf* rb)
void RingBufReInit(RingBuf* rb)
{
#ifdef RINGBUF_MUTEX
pthread_mutex_lock(&rb->mutex);
......
......@@ -151,9 +151,6 @@ static ini_bitdesc_t web_options[] = {
#ifdef DLLEXPORT
#undef DLLEXPORT
#endif
#ifdef DLLCALL
#undef DLLCALL
#endif
#ifdef _WIN32
#ifdef WEBSRVR_EXPORTS
......@@ -161,22 +158,16 @@ static ini_bitdesc_t web_options[] = {
#else
#define DLLEXPORT __declspec(dllimport)
#endif
#ifdef __BORLANDC__
#define DLLCALL
#else
#define DLLCALL
#endif
#else
#define DLLEXPORT
#define DLLCALL
#endif
#ifdef __cplusplus
extern "C" {
#endif
DLLEXPORT void DLLCALL web_server(void* arg);
DLLEXPORT void DLLCALL web_terminate(void);
DLLEXPORT const char* DLLCALL web_ver(void);
DLLEXPORT void web_server(void* arg);
DLLEXPORT void web_terminate(void);
DLLEXPORT const char* web_ver(void);
#ifdef __cplusplus
}
#endif
......
......@@ -52,11 +52,6 @@
#endif
#ifdef _WIN32
#ifdef __BORLANDC__
#define UIFCCALL
#else
#define UIFCCALL
#endif
#if defined(UIFC_IMPORTS) || defined(UIFC_EXPORTS)
#if defined(UIFC_IMPORTS)
#define UIFCEXPORT __declspec( dllimport )
......@@ -70,7 +65,6 @@
#define UIFCEXPORTVAR extern
#endif
#else
#define UIFCCALL
#define UIFCEXPORT
#define UIFCEXPORTVAR extern
#endif
......@@ -530,8 +524,8 @@ UIFCEXPORTVAR char* uifcYesNoOpts[];
/* Returns 0 on success, non-zero on failure. */
/****************************************************************************/
int uifcini(uifcapi_t*); /* Original implementation based on conio */
UIFCEXPORT int UIFCCALL uifcinix(uifcapi_t*); /* Standard I/O implementation */
UIFCEXPORT int UIFCCALL uifcini32(uifcapi_t*); /* modern implementation */
UIFCEXPORT int uifcinix(uifcapi_t*); /* Standard I/O implementation */
UIFCEXPORT int uifcini32(uifcapi_t*); /* modern implementation */
/****************************************************************************/
#ifdef __cplusplus
......
......@@ -207,7 +207,7 @@ int inkey(void)
return(c);
}
int UIFCCALL uifcini32(uifcapi_t* uifcapi)
int uifcini32(uifcapi_t* uifcapi)
{
unsigned i;
struct text_info txtinfo;
......
......@@ -86,7 +86,7 @@ static int uprintf(int x, int y, unsigned attr, char *fmat, ...)
/* Initialization function, see uifc.h for details. */
/* Returns 0 on success. */
/****************************************************************************/
int UIFCCALL uifcinix(uifcapi_t* uifcapi)
int uifcinix(uifcapi_t* uifcapi)
{
static char* yesNoOpts[] = {"Yes", "No", NULL};
......
/* datewrap.h */
/* Wrappers for non-standard date and time functions */
/* $Id: datewrap.h,v 1.28 2019/07/24 04:08:25 rswindell Exp $ */
/****************************************************************************
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
......@@ -17,21 +13,9 @@
* See the GNU Lesser General Public License for more details: lgpl.txt or *
* http://www.fsf.org/copyleft/lesser.html *
* *
* Anonymous FTP access to the most recent released source is available at *
* ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net *
* *
* Anonymous CVS access to the development source and modification history *
* is available at cvs.synchro.net:/cvsroot/sbbs, example: *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login *
* (just hit return, no password is necessary) *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src *
* *
* For Synchronet coding style and modification guidelines, see *
* http://www.synchro.net/source.html *
* *
* You are encouraged to submit any modifications (preferably in Unix diff *
* format) via e-mail to mods@synchro.net *
* *
* Note: If this box doesn't appear square, then you need to fix your tabs. *
****************************************************************************/
......@@ -45,16 +29,16 @@ extern "C" {
#endif
/* Return difference (in seconds) in time() result from standard (0 on success) */
DLLEXPORT time_t DLLCALL checktime(void);
DLLEXPORT time_t checktime(void);
/* Implementation of mktime()/timegm() that handles common tm element conversions for you */
DLLEXPORT time_t DLLCALL sane_mktime(struct tm*);
DLLEXPORT time_t DLLCALL sane_timegm(struct tm*);
DLLEXPORT time_t sane_mktime(struct tm*);
DLLEXPORT time_t sane_timegm(struct tm*);
/* Legacy (32-bit time_t) versions of time() and mktime() */
DLLEXPORT time32_t DLLCALL time32(time32_t* tp);
DLLEXPORT time32_t DLLCALL mktime32(struct tm*);
DLLEXPORT struct tm* DLLCALL localtime32(const time32_t* t, struct tm* tm);
DLLEXPORT time32_t time32(time32_t* tp);
DLLEXPORT time32_t mktime32(struct tm*);
DLLEXPORT struct tm* localtime32(const time32_t* t, struct tm* tm);
/*********************************************************************************/
/* Win32 implementations of recursive (thread-safe) std C time functions on Unix */
......@@ -64,10 +48,10 @@ DLLEXPORT struct tm* DLLCALL localtime32(const time32_t* t, struct tm* tm);
#include <time.h> /* time_t, etc. */
DLLEXPORT struct tm* DLLCALL gmtime_r(const time_t* t, struct tm* tm);
DLLEXPORT struct tm* DLLCALL localtime_r(const time_t* t, struct tm* tm);
DLLEXPORT char* DLLCALL ctime_r(const time_t *t, char *buf);
DLLEXPORT char* DLLCALL asctime_r(const struct tm *tm, char *buf);
DLLEXPORT struct tm* gmtime_r(const time_t* t, struct tm* tm);
DLLEXPORT struct tm* localtime_r(const time_t* t, struct tm* tm);
DLLEXPORT char* ctime_r(const time_t *t, char *buf);
DLLEXPORT char* asctime_r(const struct tm *tm, char *buf);
#endif
......@@ -103,8 +87,8 @@ struct time {
};
#define getdate(x) xp_getdate(x)
DLLEXPORT void DLLCALL xp_getdate(struct date*);
DLLEXPORT void DLLCALL gettime(struct time*);
DLLEXPORT void xp_getdate(struct date*);
DLLEXPORT void gettime(struct time*);
#endif /* !Borland */
......
......@@ -33,7 +33,7 @@
#endif
#include "gen_defs.h" /* ulong */
#include "wrapdll.h" /* DLLEXPORT and DLLCALL */
#include "wrapdll.h" /* DLLEXPORT */
#if defined(__cplusplus)
extern "C" {
......@@ -105,8 +105,8 @@ extern "C" {
#define GLOB_NOMATCH 3 /* No matches found. */
#define GLOB_NOSYS 4 /* Not implemented. */
DLLEXPORT int DLLCALL glob(const char *pattern, int flags, void* unused, glob_t*);
DLLEXPORT void DLLCALL globfree(glob_t*);
DLLEXPORT int glob(const char *pattern, int flags, void* unused, glob_t*);
DLLEXPORT void globfree(glob_t*);
#endif
......@@ -140,10 +140,10 @@ extern "C" {
/* Prototypes.
*/
DLLEXPORT DIR* DLLCALL opendir (const char *__dirname);
DLLEXPORT struct dirent* DLLCALL readdir (DIR *__dir);
DLLEXPORT int DLLCALL closedir (DIR *__dir);
DLLEXPORT void DLLCALL rewinddir(DIR *__dir);
DLLEXPORT DIR* opendir (const char *__dirname);
DLLEXPORT struct dirent* readdir (DIR *__dir);
DLLEXPORT int closedir (DIR *__dir);
DLLEXPORT void rewinddir(DIR *__dir);
#elif !defined(__WATCOMC__)
#include <dirent.h> /* POSIX directory functions */
#endif
......@@ -200,37 +200,37 @@ extern "C" {
#endif
/* General file system wrappers for all platforms and compilers */
DLLEXPORT BOOL DLLCALL fexist(const char *filespec);
DLLEXPORT BOOL DLLCALL fexistcase(char *filespec); /* fixes upr/lwr case fname */
DLLEXPORT off_t DLLCALL flength(const char *filename);
DLLEXPORT time_t DLLCALL fdate(const char *filename);
DLLEXPORT time_t DLLCALL fcdate(const char* filename);
DLLEXPORT int DLLCALL setfdate(const char* filename, time_t t);
DLLEXPORT BOOL DLLCALL isdir(const char *filename);
DLLEXPORT BOOL DLLCALL isabspath(const char *filename);
DLLEXPORT BOOL DLLCALL isfullpath(const char* filename);
DLLEXPORT char* DLLCALL getfname(const char* path);
DLLEXPORT char* DLLCALL getfext(const char* path);
DLLEXPORT int DLLCALL getfattr(const char* filename);
DLLEXPORT int DLLCALL getfmode(const char* filename);
DLLEXPORT ulong DLLCALL getfilecount(const char *path);
DLLEXPORT char* DLLCALL getdirname(const char* path);
DLLEXPORT long DLLCALL getdirsize(const char* path, BOOL include_subdirs, BOOL subdir_only);
DLLEXPORT ulong DLLCALL getdisksize(const char* path, ulong unit);
DLLEXPORT ulong DLLCALL getfreediskspace(const char* path, ulong unit);
DLLEXPORT uint64_t DLLCALL getfilesizetotal(const char *path);
DLLEXPORT long DLLCALL delfiles(const char *inpath, const char *spec, size_t keep);
DLLEXPORT char* DLLCALL backslash(char* path);
DLLEXPORT BOOL DLLCALL wildmatch(const char *fname, const char *spec, BOOL path, BOOL case_sensitive);
DLLEXPORT BOOL DLLCALL wildmatchi(const char *fname, const char *spec, BOOL path);
DLLEXPORT int DLLCALL mkpath(const char* path);
DLLEXPORT BOOL fexist(const char *filespec);
DLLEXPORT BOOL fexistcase(char *filespec); /* fixes upr/lwr case fname */
DLLEXPORT off_t flength(const char *filename);
DLLEXPORT time_t fdate(const char *filename);
DLLEXPORT time_t fcdate(const char* filename);
DLLEXPORT int setfdate(const char* filename, time_t t);
DLLEXPORT BOOL isdir(const char *filename);
DLLEXPORT BOOL isabspath(const char *filename);
DLLEXPORT BOOL isfullpath(const char* filename);
DLLEXPORT char* getfname(const char* path);
DLLEXPORT char* getfext(const char* path);
DLLEXPORT int getfattr(const char* filename);
DLLEXPORT int getfmode(const char* filename);
DLLEXPORT ulong getfilecount(const char *path);
DLLEXPORT char* getdirname(const char* path);
DLLEXPORT long getdirsize(const char* path, BOOL include_subdirs, BOOL subdir_only);
DLLEXPORT ulong getdisksize(const char* path, ulong unit);
DLLEXPORT ulong getfreediskspace(const char* path, ulong unit);
DLLEXPORT uint64_t getfilesizetotal(const char *path);
DLLEXPORT long delfiles(const char *inpath, const char *spec, size_t keep);
DLLEXPORT char* backslash(char* path);
DLLEXPORT BOOL wildmatch(const char *fname, const char *spec, BOOL path, BOOL case_sensitive);
DLLEXPORT BOOL wildmatchi(const char *fname, const char *spec, BOOL path);
DLLEXPORT int mkpath(const char* path);
#if defined(__unix__)
DLLEXPORT void DLLCALL _splitpath(const char *path, char *drive, char *dir,
DLLEXPORT void _splitpath(const char *path, char *drive, char *dir,
char *fname, char *ext);
DLLEXPORT char * DLLCALL _fullpath(char *target, const char *path, size_t size);
DLLEXPORT int DLLCALL removecase(const char *path);
DLLEXPORT char * _fullpath(char *target, const char *path, size_t size);
DLLEXPORT int removecase(const char *path);
#else
#define removecase(x) remove(x)
#endif
......
/* eventwrap.h */
/* Event-related cross-platform development wrappers (Win32 API emulation) */
/* $Id: eventwrap.h,v 1.4 2018/07/24 01:13:09 rswindell Exp $ */
/****************************************************************************
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
......@@ -17,21 +13,9 @@
* See the GNU Lesser General Public License for more details: lgpl.txt or *
* http://www.fsf.org/copyleft/lesser.html *
* *
* Anonymous FTP access to the most recent released source is available at *
* ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net *
* *
* Anonymous CVS access to the development source and modification history *
* is available at cvs.synchro.net:/cvsroot/sbbs, example: *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login *
* (just hit return, no password is necessary) *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src *
* *
* For Synchronet coding style and modification guidelines, see *
* http://www.synchro.net/source.html *
* *
* You are encouraged to submit any modifications (preferably in Unix diff *
* format) via e-mail to mods@synchro.net *
* *
* Note: If this box doesn't appear square, then you need to fix your tabs. *
****************************************************************************/
......
/* filewrap.h */
/* File system-call wrappers */
/* $Id: filewrap.h,v 1.39 2019/08/31 22:16:21 rswindell Exp $ */
/****************************************************************************
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
......@@ -17,21 +13,9 @@
* See the GNU Lesser General Public License for more details: lgpl.txt or *
* http://www.fsf.org/copyleft/lesser.html *
* *
* Anonymous FTP access to the most recent released source is available at *
* ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net *
* *
* Anonymous CVS access to the development source and modification history *
* is available at cvs.synchro.net:/cvsroot/sbbs, example: *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login *
* (just hit return, no password is necessary) *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src *
* *
* For Synchronet coding style and modification guidelines, see *
* http://www.synchro.net/source.html *
* *
* You are encouraged to submit any modifications (preferably in Unix diff *
* format) via e-mail to mods@synchro.net *
* *
* Note: If this box doesn't appear square, then you need to fix your tabs. *
****************************************************************************/
......
/* General cross-platform development wrappers */
/* $Id: genwrap.h,v 1.122 2020/08/08 23:25:46 rswindell Exp $ */
// vi: tabstop=4
/****************************************************************************
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
......@@ -16,21 +13,9 @@
* See the GNU Lesser General Public License for more details: lgpl.txt or *
* http://www.fsf.org/copyleft/lesser.html *
* *
* Anonymous FTP access to the most recent released source is available at *
* ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net *
* *
* Anonymous CVS access to the development source and modification history *
* is available at cvs.synchro.net:/cvsroot/sbbs, example: *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login *
* (just hit return, no password is necessary) *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src *
* *
* For Synchronet coding style and modification guidelines, see *
* http://www.synchro.net/source.html *
* *
* You are encouraged to submit any modifications (preferably in Unix diff *
* format) via e-mail to mods@synchro.net *
* *
* Note: If this box doesn't appear square, then you need to fix your tabs. *
****************************************************************************/
......@@ -41,7 +26,7 @@
#include <string.h> /* strerror() */
#include <time.h> /* clock_t */
#include "gen_defs.h" /* ulong */
#include "wrapdll.h" /* DLLEXPORT and DLLCALL */
#include "wrapdll.h" /* DLLEXPORT and */
#if defined(__unix__)
#include <sched.h> /* sched_yield */
......@@ -242,13 +227,13 @@ extern "C" {
#endif
#if !defined(_MSC_VER) && !defined(__BORLANDC__) && !defined(__WATCOMC__)
DLLEXPORT char* DLLCALL ultoa(ulong, char*, int radix);
DLLEXPORT char* ultoa(ulong, char*, int radix);
#endif
#if defined(__unix__)
DLLEXPORT char* DLLCALL strupr(char* str);
DLLEXPORT char* DLLCALL strlwr(char* str);
DLLEXPORT char* DLLCALL strrev(char* str);
DLLEXPORT char* strupr(char* str);
DLLEXPORT char* strlwr(char* str);
DLLEXPORT char* strrev(char* str);
#if !defined(stricmp)
#define stricmp strcasecmp
#define strnicmp strncasecmp
......@@ -260,28 +245,28 @@ extern "C" {
#endif
#if defined(_WIN32)
DLLEXPORT char* DLLCALL strcasestr(const char* haystack, const char* needle);
DLLEXPORT char* strcasestr(const char* haystack, const char* needle);
#endif
/* Skip white-space chars at beginning of string */
DLLEXPORT char* DLLCALL skipsp(char* str);
DLLEXPORT char* skipsp(char* str);
/* Truncate white-space chars off end of string */
DLLEXPORT char* DLLCALL truncsp(char* str);
DLLEXPORT char* truncsp(char* str);
/* Truncate white-space chars off end of every \n-terminated line in string */
DLLEXPORT char* DLLCALL truncsp_lines(char* str);
DLLEXPORT char* truncsp_lines(char* str);
/* Truncate new-line chars off end of string */
DLLEXPORT char* DLLCALL truncnl(char* str);
DLLEXPORT char* truncnl(char* str);
#define STRERROR(x) strerror(x)
/* Re-entrant version of strerror() */
DLLEXPORT char* DLLCALL safe_strerror(int errnum, char* buf, size_t buflen);
DLLEXPORT char* safe_strerror(int errnum, char* buf, size_t buflen);
/*********************/
/* Utility Functions */
/*********************/
/* Thunking for multi-threaded specific implementations of "errno" */
DLLEXPORT int DLLCALL get_errno(void);
DLLEXPORT int get_errno(void);
/**********************************/
/* Common Utility Macro Functions */
......@@ -362,37 +347,37 @@ DLLEXPORT int DLLCALL get_errno(void);
/* Win32 implementations of recursive (thread-safe) std C time functions on Unix */
#if !defined(__unix__)
DLLEXPORT char* DLLCALL strtok_r(char *str, const char *delim, char **last);
DLLEXPORT char* strtok_r(char *str, const char *delim, char **last);
#endif
/* Mimic the Borland randomize() and random() CRTL functions */
DLLEXPORT void DLLCALL xp_randomize(void);
DLLEXPORT long DLLCALL xp_random(int);
DLLEXPORT long double DLLCALL xp_timer(void);
DLLEXPORT char* DLLCALL os_version(char *str);
DLLEXPORT char* DLLCALL os_cmdshell(void);
DLLEXPORT char* DLLCALL lastchar(const char* str);
DLLEXPORT int DLLCALL safe_snprintf(char *dst, size_t size, const char *fmt, ...)
DLLEXPORT void xp_randomize(void);
DLLEXPORT long xp_random(int);
DLLEXPORT long double xp_timer(void);
DLLEXPORT char* os_version(char *str);
DLLEXPORT char* os_cmdshell(void);
DLLEXPORT char* lastchar(const char* str);
DLLEXPORT int safe_snprintf(char *dst, size_t size, const char *fmt, ...)
#if defined(__GNUC__) // Catch printf-format errors
__attribute__ ((format (printf, 3 , 4))); // 1 is 'this'
#endif
;
/* C string/char escape-sequence processing */
DLLEXPORT char* DLLCALL c_escape_str(const char* src, char* dst, size_t maxlen, BOOL ctrl_only);
DLLEXPORT char* DLLCALL c_escape_char(char ch);
DLLEXPORT char* DLLCALL c_unescape_str(char* str);
DLLEXPORT char DLLCALL c_unescape_char_ptr(const char* str, char** endptr);
DLLEXPORT char DLLCALL c_unescape_char(char ch);
DLLEXPORT char* c_escape_str(const char* src, char* dst, size_t maxlen, BOOL ctrl_only);
DLLEXPORT char* c_escape_char(char ch);
DLLEXPORT char* c_unescape_str(char* str);
DLLEXPORT char c_unescape_char_ptr(const char* str, char** endptr);
DLLEXPORT char c_unescape_char(char ch);
/* Power-of-2 byte count string parser (e.g. "100K" returns 102400 if unit is 1) */
DLLEXPORT int64_t DLLCALL parse_byte_count(const char*, ulong unit);
DLLEXPORT double DLLCALL parse_duration(const char*);
DLLEXPORT char* DLLCALL duration_to_str(double value, char* str, size_t size);
DLLEXPORT char* DLLCALL duration_to_vstr(double value, char* str, size_t size);
DLLEXPORT char* DLLCALL byte_count_to_str(int64_t bytes, char* str, size_t size);
DLLEXPORT char* DLLCALL byte_estimate_to_str(int64_t bytes, char* str, size_t size, ulong unit, int precision);
DLLEXPORT int64_t parse_byte_count(const char*, ulong unit);
DLLEXPORT double parse_duration(const char*);
DLLEXPORT char* duration_to_str(double value, char* str, size_t size);
DLLEXPORT char* duration_to_vstr(double value, char* str, size_t size);
DLLEXPORT char* byte_count_to_str(int64_t bytes, char* str, size_t size);
DLLEXPORT char* byte_estimate_to_str(int64_t bytes, char* str, size_t size, ulong unit, int precision);
/* Microsoft (e.g. DOS/Win32) real-time system clock API (ticks since process started) */
typedef clock_t msclock_t;
......@@ -404,8 +389,8 @@ typedef clock_t msclock_t;
msclock_t msclock(void);
#endif
DLLEXPORT BOOL DLLCALL check_pid(pid_t);
DLLEXPORT BOOL DLLCALL terminate_pid(pid_t);
DLLEXPORT BOOL check_pid(pid_t);
DLLEXPORT BOOL terminate_pid(pid_t);
#if defined(__cplusplus)
}
......
......@@ -79,98 +79,98 @@ typedef struct link_list {
} link_list_t;
/* Initialization, Allocation, and Freeing of Lists and Nodes */
DLLEXPORT link_list_t* DLLCALL listInit(link_list_t* /* NULL to auto-allocate */, long flags);
DLLEXPORT BOOL DLLCALL listFree(link_list_t*);
DLLEXPORT long DLLCALL listFreeNodes(link_list_t*);
DLLEXPORT BOOL DLLCALL listFreeNodeData(list_node_t* node);
DLLEXPORT link_list_t* listInit(link_list_t* /* NULL to auto-allocate */, long flags);
DLLEXPORT BOOL listFree(link_list_t*);
DLLEXPORT long listFreeNodes(link_list_t*);
DLLEXPORT BOOL listFreeNodeData(list_node_t* node);
/* Increment/decrement reference counter (and auto-free when zero), returns -1 on error */
DLLEXPORT long DLLCALL listAttach(link_list_t*);
DLLEXPORT long DLLCALL listDetach(link_list_t*);
DLLEXPORT long listAttach(link_list_t*);
DLLEXPORT long listDetach(link_list_t*);
#if defined(LINK_LIST_THREADSAFE)
DLLEXPORT BOOL DLLCALL listSemPost(link_list_t*);
DLLEXPORT BOOL DLLCALL listSemWait(link_list_t*);
DLLEXPORT BOOL DLLCALL listSemTryWait(link_list_t*);
DLLEXPORT BOOL DLLCALL listSemTryWaitBlock(link_list_t*, unsigned long timeout);
DLLEXPORT BOOL listSemPost(link_list_t*);
DLLEXPORT BOOL listSemWait(link_list_t*);
DLLEXPORT BOOL listSemTryWait(link_list_t*);
DLLEXPORT BOOL listSemTryWaitBlock(link_list_t*, unsigned long timeout);
#endif
/* Lock/unlock linked lists (works best for mutex-protected lists) */
/* Locks are recursive (e.g. must call Unlock for each call to Lock */
DLLEXPORT BOOL DLLCALL listLock(link_list_t*);
DLLEXPORT BOOL DLLCALL listUnlock(link_list_t*);
DLLEXPORT BOOL DLLCALL listIsLocked(const link_list_t*);
DLLEXPORT BOOL listLock(link_list_t*);
DLLEXPORT BOOL listUnlock(link_list_t*);
DLLEXPORT BOOL listIsLocked(const link_list_t*);
#define listForceUnlock(list) while(listUnlock(list)==TRUE)
/* Return count or index of nodes, or -1 on error */
DLLEXPORT long DLLCALL listCountNodes(link_list_t*);
DLLEXPORT long DLLCALL listNodeIndex(link_list_t*, list_node_t*);
DLLEXPORT long listCountNodes(link_list_t*);
DLLEXPORT long listNodeIndex(link_list_t*, list_node_t*);
/* Get/Set list private data */
DLLEXPORT void* DLLCALL listSetPrivateData(link_list_t*, void*);
DLLEXPORT void* DLLCALL listGetPrivateData(link_list_t*);
DLLEXPORT void* listSetPrivateData(link_list_t*, void*);
DLLEXPORT void* listGetPrivateData(link_list_t*);
/* Return an allocated string list (which must be freed), array of all strings in linked list */
DLLEXPORT str_list_t DLLCALL listStringList(link_list_t*);
DLLEXPORT str_list_t listStringList(link_list_t*);
/* Return an allocated string list (which must be freed), subset of strings in linked list */
DLLEXPORT str_list_t DLLCALL listSubStringList(const list_node_t*, long max);
DLLEXPORT str_list_t listSubStringList(const list_node_t*, long max);
/* Free a string list returned from either of the above functions */
DLLEXPORT void* DLLCALL listFreeStringList(str_list_t);
DLLEXPORT void* listFreeStringList(str_list_t);
/* Extract subset (up to max number of nodes) in linked list (src_node) and place into dest_list */
/* dest_list == NULL, then allocate a return a new linked list */
DLLEXPORT link_list_t* DLLCALL listExtract(link_list_t* dest_list, const list_node_t* src_node, long max);
DLLEXPORT link_list_t* listExtract(link_list_t* dest_list, const list_node_t* src_node, long max);
/* Simple search functions returning found node or NULL on error */
DLLEXPORT list_node_t* DLLCALL listNodeAt(link_list_t*, long index);
DLLEXPORT list_node_t* listNodeAt(link_list_t*, long index);
/* Find a specific node by data or tag */
/* Pass length of 0 to search by data pointer rather than by data content comparison (memcmp) */
DLLEXPORT list_node_t* DLLCALL listFindNode(link_list_t*, const void* data, size_t length);
DLLEXPORT list_node_t* listFindNode(link_list_t*, const void* data, size_t length);
/* Find a specific node by its tag value */
#define listFindTaggedNode(list, tag) listFindNode(list, NULL, tag)
/* Pass length of 0 to search by data pointer rather than by data content comparison (memcmp) */
DLLEXPORT ulong DLLCALL listCountMatches(link_list_t*, const void* data, size_t length);
DLLEXPORT ulong listCountMatches(link_list_t*, const void* data, size_t length);
/* Convenience functions */
DLLEXPORT list_node_t* DLLCALL listFirstNode(link_list_t*);
DLLEXPORT list_node_t* DLLCALL listLastNode(link_list_t*);
DLLEXPORT list_node_t* DLLCALL listNextNode(const list_node_t*);
DLLEXPORT list_node_t* DLLCALL listPrevNode(const list_node_t*);
DLLEXPORT void* DLLCALL listNodeData(const list_node_t*);
DLLEXPORT list_node_t* listFirstNode(link_list_t*);
DLLEXPORT list_node_t* listLastNode(link_list_t*);
DLLEXPORT list_node_t* listNextNode(const list_node_t*);
DLLEXPORT list_node_t* listPrevNode(const list_node_t*);
DLLEXPORT void* listNodeData(const list_node_t*);
/* Primitive node locking (not recursive) */
DLLEXPORT BOOL DLLCALL listLockNode(list_node_t*);
DLLEXPORT BOOL DLLCALL listUnlockNode(list_node_t*);
DLLEXPORT BOOL DLLCALL listNodeIsLocked(const list_node_t*);
DLLEXPORT BOOL listLockNode(list_node_t*);
DLLEXPORT BOOL listUnlockNode(list_node_t*);
DLLEXPORT BOOL listNodeIsLocked(const list_node_t*);
/* Add node to list, returns pointer to new node or NULL on error */
DLLEXPORT list_node_t* DLLCALL listAddNode(link_list_t*, void* data, list_node_tag_t, list_node_t* after /* NULL=insert */);
DLLEXPORT list_node_t* listAddNode(link_list_t*, void* data, list_node_tag_t, list_node_t* after /* NULL=insert */);
/* Add array of node data to list, returns number of nodes added (or negative on error) */
/* tag array may be NULL */
DLLEXPORT long DLLCALL listAddNodes(link_list_t*, void** data, list_node_tag_t*, list_node_t* after /* NULL=insert */);
DLLEXPORT long listAddNodes(link_list_t*, void** data, list_node_tag_t*, list_node_t* after /* NULL=insert */);
/* Add node to list, allocating and copying the data for the node */
DLLEXPORT list_node_t* DLLCALL listAddNodeData(link_list_t*, const void* data, size_t length, list_node_tag_t, list_node_t* after);
DLLEXPORT list_node_t* listAddNodeData(link_list_t*, const void* data, size_t length, list_node_tag_t, list_node_t* after);
/* Add node to list, allocating and copying ASCIIZ string data */
DLLEXPORT list_node_t* DLLCALL listAddNodeString(link_list_t*, const char* str, list_node_tag_t, list_node_t* after);
DLLEXPORT list_node_t* listAddNodeString(link_list_t*, const char* str, list_node_tag_t, list_node_t* after);
/* Add a list of strings to the linked list, allocating and copying each */
/* tag array may be NULL */
DLLEXPORT long DLLCALL listAddStringList(link_list_t*, str_list_t, list_node_tag_t*, list_node_t* after);
DLLEXPORT long listAddStringList(link_list_t*, str_list_t, list_node_tag_t*, list_node_t* after);
/* Add a list of nodes from a source linked list */
DLLEXPORT long DLLCALL listAddNodeList(link_list_t*, const link_list_t* src, list_node_t* after);
DLLEXPORT long listAddNodeList(link_list_t*, const link_list_t* src, list_node_t* after);
/* Merge a source linked list into the destination linked list */
/* after merging, the nodes in the source linked list should not be modified or freed */