This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
magicka/bbs.h

147 lines
3.0 KiB
C
Raw Normal View History

2016-03-22 01:48:59 +00:00
#ifndef __BBS_H__
#define __BBS_H__
#include <time.h>
#define VERSION_MAJOR 0
#define VERSION_MINOR 1
#define VERSION_STR "dev"
2016-03-24 07:23:42 +00:00
#define NETWORK_FIDO 0
#define TYPE_LOCAL_AREA 0
#define TYPE_NETMAIL_AREA 1
#define TYPE_ECHOMAIL_AREA 2
struct fido_addr {
unsigned short zone;
unsigned short net;
unsigned short node;
unsigned short point;
};
2016-03-23 05:21:53 +00:00
struct last10_callers {
char name[17];
char location[33];
time_t time;
}__attribute__((packed));
struct door_config {
char *name;
char key;
char *command;
int stdio;
};
2016-03-22 03:07:42 +00:00
struct mail_area {
char *name;
char *path;
int read_sec_level;
int write_sec_level;
2016-03-24 07:23:42 +00:00
int type;
2016-03-22 03:07:42 +00:00
};
struct mail_conference {
char *name;
char *path;
2016-03-22 08:19:06 +00:00
int networked;
2016-03-24 07:23:42 +00:00
int nettype;
int realnames;
2016-03-22 03:07:42 +00:00
int sec_level;
int mail_area_count;
struct mail_area **mail_areas;
2016-03-24 07:23:42 +00:00
struct fido_addr *fidoaddr;
2016-03-22 03:07:42 +00:00
};
2016-03-24 02:54:15 +00:00
struct file_sub {
char *name;
char *database;
int upload_sec_level;
int download_sec_level;
};
struct file_directory {
char *name;
char *path;
int sec_level;
int file_sub_count;
struct file_sub **file_subs;
};
2016-03-22 01:48:59 +00:00
struct bbs_config {
char *bbs_name;
char *sysop_name;
char *ansi_path;
char *bbs_path;
char *email_path;
char *irc_server;
int irc_port;
char *irc_channel;
2016-03-22 01:48:59 +00:00
int nodes;
int newuserlvl;
2016-03-22 03:07:42 +00:00
int mail_conference_count;
struct mail_conference **mail_conferences;
int door_count;
struct door_config **doors;
2016-03-24 02:54:15 +00:00
int file_directory_count;
struct file_directory **file_directories;
2016-03-22 01:48:59 +00:00
};
struct sec_level_t {
int timeperday;
};
struct user_record {
int id;
char *loginname;
char *password;
char *firstname;
char *lastname;
char *email;
char *location;
int sec_level;
struct sec_level_t *sec_info;
time_t laston;
int timeleft;
2016-03-22 03:07:42 +00:00
int cur_mail_conf;
int cur_mail_area;
int cur_file_dir;
int cur_file_sub;
2016-03-23 06:31:00 +00:00
int timeson;
2016-03-22 01:48:59 +00:00
};
extern void runbbs(int sock, char *config);
2016-03-24 07:23:42 +00:00
extern struct fido_addr *parse_fido_addr(const char *str);
2016-03-22 01:48:59 +00:00
extern void s_putchar(int socket, char c);
extern void s_putstring(int socket, char *c);
extern void s_displayansi(int socket, char *file);
extern char s_getchar(int socket);
extern void s_readstring(int socket, char *buffer, int max);
extern char s_getc(int socket);
extern void disconnect(int socket);
2016-03-23 00:14:31 +00:00
extern void display_info(int socket);
2016-03-23 05:21:53 +00:00
extern void display_last10_callers(int socket, struct user_record *user, int record);
2016-03-22 01:48:59 +00:00
extern int save_user(struct user_record *user);
extern int check_user(char *loginname);
extern struct user_record *new_user(int socket);
extern struct user_record *check_user_pass(int socket, char *loginname, char *password);
2016-03-23 06:31:00 +00:00
extern void list_users(int socket, struct user_record *user);
2016-03-22 01:48:59 +00:00
extern void main_menu(int socket, struct user_record *user);
2016-03-22 03:07:42 +00:00
2016-03-26 06:06:59 +00:00
extern void mail_scan(int socket, struct user_record *user);
2016-03-23 00:14:31 +00:00
extern int mail_getemailcount(struct user_record *user);
2016-03-22 03:07:42 +00:00
extern int mail_menu(int socket, struct user_record *user);
extern int door_menu(int socket, struct user_record *user);
2016-03-25 10:21:28 +00:00
extern void bbs_list(int socket, struct user_record *user);
extern void chat_system(int sock, struct user_record *user);
2016-03-22 01:48:59 +00:00
#endif