Пример #1
0
EFI_STATUS
EFIAPI
//UefiMain (
//  IN EFI_HANDLE        ImageHandle,
//  IN EFI_SYSTEM_TABLE  *SystemTable
//  )
ShellAppMain (
  IN UINTN Argc,
  IN CHAR16 **Argv
  )
{
    EFI_STATUS  Status;

    //ST = SystemTable;
    //BS = SystemTable->BootServices;
    ST = gST;
    BS = gBS;
    //    InitializeLib (ImageHandle, SystemTable);

    Status = ParseCommandLine(Argc, Argv);

    if (EFI_ERROR(Status))
    {
        Print(L"Wrong parameters usage!\n");
        return Status;
    }

    if (GO_PRINT_HELP)
    {
        Print_Help();
    }

    if (GO_PRINT_MENU)
        Print_Menu();

    if (GO_PRINT_TEXT)
    {
        Print(L"Do text dump here!\n");
    }


    return EFI_SUCCESS;
}
Пример #2
0
void main ()
{
   int menu;
   char c;
   Flights f;
   Reservations r;

   // Icrease CPassanger counters in FDB
   if (r.SetCounters(f)==-1)
   {
   	cout << "\n!!! Error found in reservation datebase !!!\n";
      exit(1);
   }

   cout << "\nReady:\n";
  	Print_Menu(mode);

   do
   {
   cout << "\n\nFAIRAIR: Enter Command (2..9, 0-help, 1-exit) : ";
   menu=-1;
   do
   { cin >> c;
     if (isdigit(c)) menu=c-'0';
   } while (menu==-1);
      switch (menu)
      {
      	case 0:
         	// Print this menu
	         Print_Menu(mode);
            break;
         case 1:
         	// Exit
            break;
         case 2:
         	// Show list of cities serviced by FairAir
	         f.PrintCityList();
            break;
         case 3:
       	   // Show flight departures for a city listed in order of time
            f.CityDepartureList();
	    break;
         case 4:
         	// Show flight arrivals for a city listed in order of time
            f.CityArrivalList();
	     break;
         case 5:
            r.MakeReserve(f);
         	// Make an airline reservation for a passanger
            break;
         case 6:
         	// Print list of passangers, by last name
            r.PrintPassengers();
		 break;
         case 7:
         	// Print a passenger's reservation schedule
            r.PrintSchedule(f);
		 break;
         case 8:
         	// Delete a passenger's reservation
       		r.DeleteReserve(f);
		     break;
         case 9:
         	// Change Find Route mode
	    if (mode)
		  cout<< "\nFind Route mode changed to SELECT."; else
		  cout<< "\nFind Route mode changed to OPTIMAL.";
        mode=!mode;
            break;
         default:
         	// Unknown command
            cout << "\n Error : Unknown Command";
            break;
      }
   } while (menu!=1);
   r.WriteReservations();
   cout << "\n\nProgram finished.\n\n";
}