summaryrefslogblamecommitdiffstats
path: root/microbbs.c
blob: 8a04fc61de192ca9267db2c194ecc4a6f45a93c1 (plain) (tree)
1
2
3
4
5
6
7
8
9

                       


                   
 
                    
                 
                 

                     
                 
                      

                 
                 
                    
                     
 
                         
                            
 

                
 

                                 
                               
 

                              
 



                                   
                                                             
                         
                                 
                                      
                            
 
                                          
                   
                                 
      
 

                                                           
                                       


                                           
                                

      
                                                      
                                          
                                                      
                  

                                             
                           

      
                                     
         






                                                     

                                                                         
                                                        

              
                          
                                             


                              
                                                 


                               
                                                   


                          
                                             


                           
                                              


                           
                                                                         
                                                      


                          
                                             
              

                               
                                                

              
                                                       


                                                              
                                       







                                                                                    
                 























                                                                                    
                                                                                      








                                                                                    

                                                                   








                                                                                    
                                                              








                                                                                    
                                                                        








                                                                                    
                                                                     









                                                                                    
                                                         








                                                                                    
                                                                         











                                                                                    
                                                                      

                 
                  

                                             
      
 
                      

                                  
                 
                                                                            
 
#define __MICROBBS_MAIN

#include <stdio.h>
#include <stdlib.h>


#include "kconfig.h"
#include "logs.h"
#include "motd.h"
#include "sysinfo.h"
#include "articles.h"
#include "user.h"
#include "bbsconfig.h"
#include "twit.h"
#include "todo.h"
#include "door.h"
#include "captcha.h"
#include "netbytes.h"

#include "libterm/term.h"
#include "libterm/term_io.h"

#include "ini.h"


int main( int argc, char **argv )
{
	int quit_main_menu = 0;

	int main_menu_input=0;
	char main_menu_cmd;

	//set default config values
	config_default();

	//setting up terminal
	term_screen ts; memset( (void *)&ts, 0, sizeof(ts) );
	term_init( &ts );
	term_set_raw_mode( &ts );
	term_set_speed( &ts, B38400 );
	term_clr_scr( &ts );

	//init global variable of bbs user
#ifdef CONFIG_LOGIN
	bbs_user_init( &g_user );
#endif

	//lunch captcha and try to detect if its random bot
#ifdef CONFIG_CAPTCHA
	if ( captcha_test1( &ts ) != 1)
	{
		goto exit_restore_terminal;
	}
	bbs_log_captcha( NULL );
#endif

	//write to log that some user have accesed bbs
	//too much fake stuff comes to log
	bbs_log_main( NULL ); //write to default place
#ifdef CONFIG_MOTD
	bbs_motd_draw( &ts, "art/motd.txt" );
	sleep( 3 );
	print_build_info();
#endif

	while ( quit_main_menu == 0 )
	{
		//prepare screen for main menu output
		term_clr_scr( &ts );
		//column = term_cur_pos_c( &ts );
		//row = term_cur_pos_r(