RedfishPkg/Include: add common RedfishPkg header file.

IS_EMPTY_STRING macro is defined in multiple drivers in RedfishPkg.
So, I create RedfishCommon.h to keep common macros that we can use
in RedfishPkg.

Signed-off-by: Nickle Wang <nicklew@nvidia.com>
This commit is contained in:
Nickle Wang 2024-09-09 11:09:35 +08:00 committed by mergify[bot]
parent 8b295e0aad
commit 48b5815d77
5 changed files with 22 additions and 11 deletions

View File

@ -0,0 +1,17 @@
/** @file
This header file defines common macros for the use in RedfishPkg.
Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef REDFISH_COMMON_H_
#define REDFISH_COMMON_H_
#ifndef IS_EMPTY_STRING
#define IS_EMPTY_STRING(a) ((a) == NULL || (a)[0] == '\0')
#endif
#endif

View File

@ -9,7 +9,7 @@
**/
#include <Uefi.h>
#include <RedfishCommon.h>
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
@ -17,10 +17,6 @@
#include <Library/RedfishHttpLib.h>
#include <Library/UefiLib.h>
#ifndef IS_EMPTY_STRING
#define IS_EMPTY_STRING(a) ((a) == NULL || (a)[0] == '\0')
#endif
#define REDFISH_JSON_STRING_LENGTH 200
#define REDFISH_JSON_OUTPUT_FORMAT (EDKII_JSON_COMPACT | EDKII_JSON_INDENT(2))
#define REDFISH_PRINT_BUFFER_BYTES_PER_ROW 16

View File

@ -3,6 +3,7 @@
(C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
(C) Copyright 2024 American Megatrends International LLC<BR>
Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
@ -11,6 +12,7 @@
#ifndef EDKII_REDFISH_CREDENTIAL_DXE_H_
#define EDKII_REDFISH_CREDENTIAL_DXE_H_
#include <RedfishCommon.h>
#include <Protocol/EdkIIRedfishCredential2.h>
#include <Library/BaseLib.h>
@ -29,10 +31,6 @@
#define REDFISH_MANAGER_ACCOUNT_COLLECTION_URI L"AccountService/Accounts"
#define REDFISH_URI_LENGTH 128
#ifndef IS_EMPTY_STRING
#define IS_EMPTY_STRING(a) ((a) == NULL || (a)[0] == '\0')
#endif
///
/// Definition of REDFISH_SERVICE_LIST
///

View File

@ -11,6 +11,7 @@
#define EDKII_REDFISH_HTTP_DXE_H_
#include <Uefi.h>
#include <RedfishCommon.h>
#include <IndustryStandard/Http11.h>
#include <Library/UefiLib.h>
@ -31,7 +32,6 @@
#include <Protocol/EdkIIRedfishCredential2.h>
#include <Protocol/RestEx.h>
#define IS_EMPTY_STRING(a) ((a) == NULL || (a)[0] == '\0')
#define REDFISH_HTTP_CACHE_LIST_SIZE 0x80
#define REDFISH_ERROR_MSG_MAX 128
#define REDFISH_DEBUG_STRING_LENGTH 200

View File

@ -13,6 +13,7 @@
#define EDKII_REDFISH_PLATFORM_CONFIG_IMPL_H_
#include <Uefi.h>
#include <RedfishCommon.h>
//
// Libraries
@ -27,7 +28,6 @@
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiLib.h>
#define IS_EMPTY_STRING(a) (a == NULL || a[0] == L'\0')
#define ENGLISH_LANGUAGE_CODE "en-US"
#define X_UEFI_SCHEMA_PREFIX "x-UEFI-redfish-"