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

bbslist.h 3.33 KB
Newer Older
deuce's avatar
deuce committed
1 2
/* Copyright (C), 2007 by Stephen Hurd */

3
/* $Id: bbslist.h,v 1.57 2020/06/27 08:27:39 deuce Exp $ */
4

5 6 7
#ifndef _BBSLIST_H_
#define _BBSLIST_H_

8
#include <stdio.h>  /* FILE * */
9
#include "gen_defs.h"
10
#include "dirwrap.h"    /* MAX_PATH */
11
#include "ini_file.h"
12 13
#include <time.h>

14
#if defined(_WIN32)
15
    #include <malloc.h> /* alloca() on Win32 */
16 17
#endif

18 19
#include <cterm.h>

20 21 22 23 24
#define LIST_NAME_MAX   30
#define LIST_ADDR_MAX   64
#define MAX_USER_LEN    30
#define MAX_PASSWD_LEN  128
#define MAX_SYSPASS_LEN 128
25

26
enum {
27 28
     USER_BBSLIST
    ,SYSTEM_BBSLIST
29 30
};

31
enum {
32 33
     BBSLIST_SELECT
    ,BBSLIST_EDIT
34 35
};

36
enum {
37 38
     SCREEN_MODE_CURRENT
    ,SCREEN_MODE_80X25
39
    ,SCREEN_MODE_LCD80X25
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
    ,SCREEN_MODE_80X28
    ,SCREEN_MODE_80X30
    ,SCREEN_MODE_80X43
    ,SCREEN_MODE_80X50
    ,SCREEN_MODE_80X60
    ,SCREEN_MODE_132X37
    ,SCREEN_MODE_132x52
    ,SCREEN_MODE_132X25
    ,SCREEN_MODE_132X28
    ,SCREEN_MODE_132X30
    ,SCREEN_MODE_132X34
    ,SCREEN_MODE_132X43
    ,SCREEN_MODE_132X50
    ,SCREEN_MODE_132X60
    ,SCREEN_MODE_C64
    ,SCREEN_MODE_C128_40
    ,SCREEN_MODE_C128_80
    ,SCREEN_MODE_ATARI
    ,SCREEN_MODE_ATARI_XEP80
    ,SCREEN_MODE_CUSTOM
    ,SCREEN_MODE_EGA_80X25
Deucе's avatar
Deucе committed
61
    ,SCREEN_MODE_VGA_80X25
62
    ,SCREEN_MODE_TERMINATOR
63 64
};

65
enum {
66 67 68
     ADDRESS_FAMILY_UNSPEC
    ,ADDRESS_FAMILY_INET
    ,ADDRESS_FAMILY_INET6
69 70
};

Deucе's avatar
Deucе committed
71 72 73 74 75 76
enum {
	 RIP_VERSION_NONE
	,RIP_VERSION_1
	,RIP_VERSION_3
};

77
/* NOTE: changing this may require updating sort_order in bbslist.c */
78
struct bbslist {
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
    char            name[LIST_NAME_MAX+1];
    char            addr[LIST_ADDR_MAX+1];
    short unsigned int port;
    time_t          added;
    time_t          connected;
    unsigned int    calls;
    char            user[MAX_USER_LEN+1];
    char            password[MAX_PASSWD_LEN+1];
    char            syspass[MAX_SYSPASS_LEN+1];
    int             type;
    int             conn_type;
    int             id;
    int             screen_mode;
    int             nostatus;
    char            dldir[MAX_PATH+1];
    char            uldir[MAX_PATH+1];
    char            logfile[MAX_PATH+1];
    BOOL            append_logfile;
    int             xfer_loglevel;
    int             telnet_loglevel;
    int             bpsrate;
    int             music;
    int             address_family;
    char            font[80];
    int             hidepopups;
    char            ghost_program[9]; /* GHost program can only be 8 chars max. */
    int             rip;
    int             flow_control;
107
    char            comment[1024];
108 109
};

110 111 112
extern char *music_names[];
extern char music_helpbuf[];

113
struct bbslist *show_bbslist(char *current, int connected);
114
extern char *log_levels[];
115 116
extern char *rate_names[];
extern int rates[];
117
extern int sortorder[];
118
extern ini_style_t ini_style;
119
extern char *screen_modes_enum[];
120
void read_item(str_list_t listfile, struct bbslist *entry, char *bbsname, int id, int type);
121
void read_list(char *listpath, struct bbslist **list, struct bbslist *defaults, int *i, int type);
deuce's avatar
deuce committed
122 123
void free_list(struct bbslist **list, int listcount);
void add_bbs(char *listpath, struct bbslist *bbs);
deuce's avatar
deuce committed
124
int edit_list(struct bbslist **list, struct bbslist *item,char *listpath,int isdefault);
125
int  get_rate_num(int rate);
126
cterm_emulation_t get_emulation(struct bbslist *bbs);
127
const char *get_emulation_str(cterm_emulation_t emu);
128
void get_term_size(struct bbslist *bbs, int *cols, int *rows);
129 130

#endif