int do_init_itemdb(void) { item_db = db_alloc(__FILE__,__LINE__,DB_INT,DB_OPT_BASE,sizeof(int)); create_dummy_data(); //Dummy data item. itemdb_read(); return 0; }
int do_init_itemdb(void) { item_db = idb_alloc(DB_OPT_BASE); create_dummy_data(); //Dummy data item. itemdb_read(); return 0; }
int do_init_itemdb (void) { memset (itemdb_array, 0, sizeof (itemdb_array)); itemdb_other = idb_alloc (DB_OPT_BASE); create_dummy_data(); //Dummy data item. itemdb_read(); return 0; }
/**************************** * functions ****************************/ void start_admin( void ) { // printf("7[%s:%d]\n", __FILE__, __LINE__); // printf("*** Under construction ***\n"); /* variables * 1. work:char[] * => choice number: undefined * 2. loop:int * => flag for while loop: 1 * 3. ret:int * => return of a function */ char work[128]; int loop = 1; int ret; /* loop: choince input */ while (loop) { printf( "\n" ); printf( "\n *************************************" ); printf( "\n ±½ÚÁ¯¸ ¸×ÌÞ ÒÝÊÞ° ¶ÝØ ÌßÛ¸Þ×Ñ: admin " ); printf( "\n *************************************" ); printf( "\n ¼®Ø ¦ ¾ÝÀ¸ ¼Ã¸ÀÞ»²" ); printf( "\n 1: Show the akicode_tbl" ); printf( "\n 2: Show the codedata_tbl" ); printf( "\n 3: Delete a record" ); //printf( "\n 3: Get a record from the akicode_tbl" ); printf( "\n 4: Create dummy data" ); printf( "\n E: Back to the main menu" ); printf( "\n Q: Quit the program" ); printf( "\n ? " ); /* ¼®Ø¸ÌÞÝ Æ³Ø®¸ */ work[ 0 ] = '\0'; scanf( "%s", work ); /* Ƴخ¸ ¹À½³ Áª¯¸ -> 1²¶Þ² ? */ if( strlen( work ) != 1 ) { printf( "\n Ƴخ¸ н ÃÞ½" ); continue; } /* switching * 1 => get_akicode_tbl * E => quit */ switch( work[ 0 ] ) { /* get akicode_tbl */ case '1': akicode_tbl_disp(); printf("\nShow the akicode_tbl" " => complete\n"); break; /* get a record from the akicode_tbl */ case '2': codedata_tbl_disp(); printf("\nget_record_from_akicode_tbl" " => complete\n"); break; /* get a record from the akicode_tbl */ case '3': touroku_sakujyo(); printf("\nget_record_from_akicode_tbl" " => complete\n"); break; /* get a record from the akicode_tbl */ case '4': create_dummy_data(); printf("\nget_record_from_akicode_tbl" " => complete\n"); break; /* get codedata_tbl */ /* back to main */ case 'E': case 'e': /* show message */ printf("\n\tLeave the admin\n"); loop = FALSE; break; /* Quit */ case 'Q': case 'q': /* show message */ printf("\n\tQuit\n"); exit(0); default: printf( "\n Ƴخ¸ н ÃÞ½" ); break; }//switch( work[ 0 ] ) }//while (loop) }//void start_admin( void )