diff options
author | FreeArtMan <dos21h@gmail.com> | 2014-12-29 11:17:49 +0900 |
---|---|---|
committer | FreeArtMan <dos21h@gmail.com> | 2014-12-29 11:17:49 +0900 |
commit | 7a794483c75fa6590958dda5ceaf5fb4438c3066 (patch) | |
tree | 9fde594088b1a844f5e4ad2568158f049cdd7981 | |
parent | 0aa0acedcbf8c19ad7049335c7abbb0f71e2cdee (diff) | |
download | microbbs-7a794483c75fa6590958dda5ceaf5fb4438c3066.tar.gz microbbs-7a794483c75fa6590958dda5ceaf5fb4438c3066.zip |
Small fixes, not change any functionality
-rw-r--r-- | Kconfig | 11 | ||||
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | file_use.c | 14 | ||||
-rw-r--r-- | microbbs.c | 11 | ||||
-rw-r--r-- | todo.c | 8 | ||||
-rw-r--r-- | vote.c | 2 |
6 files changed, 36 insertions, 12 deletions
@@ -1,8 +1,12 @@ menuconfig TODO bool "List of todo" option todo + default y if TODO + config TODO_DEFAULT_FILE + string "Default file location" + default "todo/todo.txt" endif menuconfig TWIT @@ -53,7 +57,14 @@ menuconfig MOTD if MOTD endif +menuconfig MESSAGING + bool "Messaging between users" + option messaging + default n + +if MESSAGING +endif config CAPTCHA bool "Enable simple captcha" @@ -1,7 +1,7 @@ PROJECT=microbbs CC=gcc CFLAGS= -SOURCES=articles.c bbsconfig.c buildinfo.c captcha.c file_use.c ini.c list.c login.c logs.c mmm.c motd.c session.c statistics.c sysinfo.c telnetd.c textview.c vote.c +SOURCES=articles.c bbsconfig.c buildinfo.c captcha.c file_use.c ini.c list.c login.c logs.c mmm.c motd.c sds.c session.c statistics.c sysinfo.c telnetd.c textview.c todo.c vote.c OBJECTS=$(SOURCES:.c=.o) BUILD_DIR=build_dir @@ -18,7 +18,7 @@ void f_file_null( f_file *f_f ) int f_file_seek( f_file *f_f, long offset, int seek ) { int ret=-1; - PRINT("\n"); + //PRINT("\n"); if ( f_f ) { if ( offset < 0 ) @@ -55,7 +55,7 @@ size_t f_file_read( f_file *f_f, size_t size, void *ptr ) { size_t ret=-1; - PRINT("\n"); + //PRINT("\n"); if ( f_f ) { if ( (f_f->flags == F_FILE_READ) || @@ -98,7 +98,7 @@ size_t f_file_readl( f_file *f_f, size_t size, void *ptr ) { size_t ret=-1; - PRINT("\n"); + //PRINT("\n"); if ( f_f ) { int c=0; @@ -127,7 +127,7 @@ int f_file_size( f_file *f_f ) int ret=-1; long old_seek; - PRINT("\n"); + //PRINT("\n"); if ( f_f ) { //could make some logic break @@ -149,7 +149,7 @@ int f_file_size( f_file *f_f ) //--------------------------------------------------------------------- size_t f_file_write( f_file *f_f, size_t size, void *ptr ) { - PRINT("\n"); + //PRINT("\n"); if ( f_f ) { if ((f_f->flags == F_FILE_WRITE) || @@ -175,7 +175,7 @@ f_file* f_file_open( const char *fname, int flags ) char *f_flags_rw="r+"; char *f_flags_tmp=NULL; - PRINT("\n"); + //PRINT("\n"); if ( fname != NULL ) { ret = malloc( sizeof( f_file ) ); @@ -228,7 +228,7 @@ exit_close_f: //--------------------------------------------------------------------- int f_file_close( f_file *f_f ) { - PRINT("\n"); + //PRINT("\n"); if ( f_f ) { fclose( f_f->fid ); @@ -6,6 +6,8 @@ #include "motd.h" #include "libterm/term.h" +#include "ini.h" + int main( int argc, char **argv ) { int ret_len; @@ -60,7 +62,12 @@ int main( int argc, char **argv ) #ifdef CONFIG_TODO printf("T(o)do "); #endif - printf("(Q)uit (S)ysinfo Mesa(G)es: "); + + #ifdef CONFIG_MESSAGING + printf("Mesa(G)es "); + #endif + + printf("(Q)uit (S)ysinfo: "); ret_len = getline( &str, &str_size, stdin ); if ( ret_len > 0) { @@ -112,12 +119,14 @@ int main( int argc, char **argv ) break; #endif + #ifndef CONFIG_MESSAGING case 'g': case 'G': { printf("Messages\n"); } break; + #endif //------------------------------------------------------------------ #ifdef CONFIG_BOARD @@ -16,6 +16,7 @@ int bbs_todo( term_screen *ts, const char *fname) if ( fname == NULL ) fname = CONFIG_TODO_DEFAULT_FILE; + //LOAD DATA FROM FILE TO LINKED LIST List *todo_list = llist_new(); f_file *file = f_file_open( fname, F_FILE_READ ); if ( file != NULL ) @@ -35,11 +36,14 @@ int bbs_todo( term_screen *ts, const char *fname) } f_file_close( file ); + //LOAD DATA FROM FILE TO LINKED LIST + //END + while( (quit_loop == 0) ) { - printf("(S)how tood list,(Q)uit:"); + printf("(S)how todo list,(Q)uit:"); ret_len = getline( &in_buf, &in_size, stdin ); if ( ret_len > 0 ) { @@ -59,7 +63,7 @@ int bbs_todo( term_screen *ts, const char *fname) int cnt = 1; while (iter != NULL) { - printf( "[%d] -> %s\n", cnt, (char *)iter->val); + printf( "[%02d] -> %s\n", cnt, (char *)iter->val); cnt += 1; iter = iter->next; } @@ -2,7 +2,7 @@ int bbs_vote( term_screen *ts, const char *s ) { - int ret=-1; + int ret = -1; |