#ifndef __MICROBBS_USER_H #define __MICROBBS_USER_H #include #include #include #include #include #include #include #include #include "kconfig.h" #include "sds.h" #include "logs.h" #include "ini.h" #include "libterm/term.h" #include "libterm/term_io.h" #define BBS_USER_GUEST 0 #define BBS_USER_LOGEDIN 1 #define BBS_USER_BLOCKED 2 #define BBS_USER_LOGEDOUT 3 #define BBS_USER_UN_SZ 32 typedef struct bbs_user { int login_status; char username[BBS_USER_UN_SZ]; } bbs_user; typedef struct user_config_file { char *password; } user_config_file; #define BBS_USER_INIT { BBS_USER_GUEST, {0} }; //GLOBAL USER #ifdef __MICROBBS_MAIN bbs_user g_user = BBS_USER_INIT; #else extern bbs_user g_user; #endif int bbs_login( term_screen *ts ); int bbs_login_auth( const char *dir, const char *username, const char *password ); int bbs_user_init( bbs_user *bu ); int bbs_user_auth( bbs_user *bu ); int bbs_user_set_status( bbs_user *bu, int status ); int bbs_user_get_status( bbs_user *bu ); #endif