]>
Commit | Line | Data |
---|---|---|
d8ab884f VO |
1 | /** @file\r |
2 | Entrypoint of "http" shell standalone application.\r | |
3 | \r | |
4 | Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved. <BR>\r | |
5 | Copyright (c) 2015, ARM Ltd. All rights reserved.<BR>\r | |
6 | Copyright (c) 2020, Broadcom. All rights reserved.<BR>\r | |
7 | \r | |
8 | SPDX-License-Identifier: BSD-2-Clause-Patent\r | |
9 | \r | |
10 | **/\r | |
11 | #include "Http.h"\r | |
12 | \r | |
13 | /*\r | |
14 | * String token ID of help message text.\r | |
15 | * Shell supports to find help message in the resource section of an\r | |
16 | * application image if * .MAN file is not found.\r | |
17 | * This global variable is added to make build tool recognizes\r | |
18 | * that the help string is consumed by user and then build tool will\r | |
19 | * add the string into the resource section.\r | |
20 | * Thus the application can use '-?' option to show help message in Shell.\r | |
21 | */\r | |
22 | GLOBAL_REMOVE_IF_UNREFERENCED\r | |
47d20b54 | 23 | EFI_STRING_ID mStringHelpTokenId = STRING_TOKEN (STR_GET_HELP_HTTP);\r |
d8ab884f VO |
24 | \r |
25 | /**\r | |
26 | Entry point of Http standalone application.\r | |
27 | \r | |
28 | @param ImageHandle The image handle of the process.\r | |
29 | @param SystemTable The EFI System Table pointer.\r | |
30 | \r | |
31 | @retval EFI_SUCCESS Http command is executed sucessfully.\r | |
32 | @retval EFI_ABORTED HII package was failed to initialize.\r | |
33 | @retval others Other errors when executing http command.\r | |
34 | **/\r | |
35 | EFI_STATUS\r | |
36 | EFIAPI\r | |
37 | HttpAppInitialize (\r | |
47d20b54 MK |
38 | IN EFI_HANDLE ImageHandle,\r |
39 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
d8ab884f VO |
40 | )\r |
41 | {\r | |
47d20b54 MK |
42 | EFI_STATUS Status;\r |
43 | SHELL_STATUS ShellStatus;\r | |
d8ab884f VO |
44 | \r |
45 | mHttpHiiHandle = InitializeHiiPackage (ImageHandle);\r | |
46 | if (mHttpHiiHandle == NULL) {\r | |
47 | return EFI_ABORTED;\r | |
48 | }\r | |
49 | \r | |
50 | Status = EFI_SUCCESS;\r | |
51 | \r | |
52 | ShellStatus = RunHttp (ImageHandle, SystemTable);\r | |
53 | \r | |
54 | HiiRemovePackages (mHttpHiiHandle);\r | |
55 | \r | |
56 | if (Status != SHELL_SUCCESS) {\r | |
57 | Status = ENCODE_ERROR (ShellStatus);\r | |
58 | }\r | |
59 | \r | |
60 | return Status;\r | |
61 | }\r |