Ejemplo n.º 1
0
void PrintJournalHeader(out_ctx* ctx, const journal_header* record)
{
    /*
       int32_t        magic;
       int32_t        endian;
       volatile off_t start;         // zero-based byte offset of the start of the first transaction
       volatile off_t end;           // zero-based byte offset of where free space begins
       off_t          size;          // size in bytes of the entire journal
       int32_t        blhdr_size;    // size in bytes of each block_list_header in the journal
       int32_t        checksum;
       int32_t        jhdr_size;     // block size (in bytes) of the journal header
       uint32_t       sequence_num;  // NEW FIELD: a monotonically increasing value assigned to all txn's
     */
    BeginSection(ctx, "Journal Header");
    PrintUIChar(ctx, record, magic);
    PrintUIHex(ctx, record, endian);
    PrintUI(ctx, record, start);
    PrintUI(ctx, record, end);
    PrintDataLength(ctx, record, size);
    PrintDataLength(ctx, record, blhdr_size);
    PrintUIHex(ctx, record, checksum);
    PrintDataLength(ctx, record, jhdr_size);
    PrintUI(ctx, record, sequence_num);
    EndSection(ctx);
}
Ejemplo n.º 2
0
void main()
{
	int nMenu = 0;
	LoadList(DATA_FILE_NAME);

	// 메인 이벤트 반복문
	while ((nMenu = PrintUI()) != 0) {
		switch (nMenu)	{
		case 1:		  // Add
			Add();
			break;

		case 2:		  // Search
			Search();
			break;

		case 3:		 // Print all
			PrintAll();
			break;

		case 4:		  // Remove
			Remove();
			break;
		}
	}

	// 종료 전에 파일로 저장하고 메모리를 해제한다.
	SaveList(DATA_FILE_NAME);
	ReleaseList();
}
Ejemplo n.º 3
0
int CUserInterface::Run(void)
{
	int nMenu = 0;
	while( (nMenu = PrintUI()) != 0 )
	{
		switch(nMenu)
		{
		case 1:		//Add
			Add();
			break;

		case 2:		//Search
			Search();
			break;

		case 3:		//Print all
			m_List.PrintAll();
			break;

		case 4:		//Remove
			Remove();
			break;
		}
	}

	return nMenu;
}