summaryrefslogtreecommitdiff
path: root/RedfishPkg/Include/Library
diff options
context:
space:
mode:
authorMichael Kubacki <michael.kubacki@microsoft.com>2021-12-05 14:54:11 -0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-12-07 17:24:28 +0000
commit39de741e2dcb8f11e9b4438e37224797643d8451 (patch)
treeddf957e0b215e0918dc53ad756c6bd047c9b7b16 /RedfishPkg/Include/Library
parent5220bd211df890f2672c23c050082862cd1e82d6 (diff)
downloadedk2-39de741e2dcb8f11e9b4438e37224797643d8451.zip
edk2-39de741e2dcb8f11e9b4438e37224797643d8451.tar.gz
edk2-39de741e2dcb8f11e9b4438e37224797643d8451.tar.bz2
RedfishPkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the RedfishPkg package Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Abner Chang <abner.chang@hpe.com>
Diffstat (limited to 'RedfishPkg/Include/Library')
-rw-r--r--RedfishPkg/Include/Library/BaseUcs2Utf8Lib.h16
-rw-r--r--RedfishPkg/Include/Library/JsonLib.h189
-rw-r--r--RedfishPkg/Include/Library/RedfishContentCodingLib.h22
-rw-r--r--RedfishPkg/Include/Library/RedfishCredentialLib.h14
-rw-r--r--RedfishPkg/Include/Library/RedfishCrtLib.h528
-rw-r--r--RedfishPkg/Include/Library/RedfishHostInterfaceLib.h13
-rw-r--r--RedfishPkg/Include/Library/RestExLib.h10
7 files changed, 550 insertions, 242 deletions
diff --git a/RedfishPkg/Include/Library/BaseUcs2Utf8Lib.h b/RedfishPkg/Include/Library/BaseUcs2Utf8Lib.h
index c698961..5017043 100644
--- a/RedfishPkg/Include/Library/BaseUcs2Utf8Lib.h
+++ b/RedfishPkg/Include/Library/BaseUcs2Utf8Lib.h
@@ -14,11 +14,11 @@
///
/// L"\u0000"
///
-#define UNICODE_FORMAT_LEN 6
-#define UNICODE_FORMAT_CHAR_LEN 2
-#define UNICODE_FORMAT_CHAR_SIZE 3
+#define UNICODE_FORMAT_LEN 6
+#define UNICODE_FORMAT_CHAR_LEN 2
+#define UNICODE_FORMAT_CHAR_SIZE 3
-#define UTF8_BUFFER_FOR_UCS2_MAX_SIZE 3
+#define UTF8_BUFFER_FOR_UCS2_MAX_SIZE 3
/**
Convert a UCS2 string to a UTF8 encoded string.
@@ -34,8 +34,8 @@
**/
EFI_STATUS
UCS2StrToUTF8 (
- IN CHAR16 *Ucs2Str,
- OUT CHAR8 **Utf8StrAddr
+ IN CHAR16 *Ucs2Str,
+ OUT CHAR8 **Utf8StrAddr
);
/**
@@ -54,8 +54,8 @@ UCS2StrToUTF8 (
**/
EFI_STATUS
UTF8StrToUCS2 (
- IN CHAR8 *Utf8Str,
- OUT CHAR16 **Ucs2StrAddr
+ IN CHAR8 *Utf8Str,
+ OUT CHAR16 **Ucs2StrAddr
);
#endif
diff --git a/RedfishPkg/Include/Library/JsonLib.h b/RedfishPkg/Include/Library/JsonLib.h
index 83959dd..f98f4e7 100644
--- a/RedfishPkg/Include/Library/JsonLib.h
+++ b/RedfishPkg/Include/Library/JsonLib.h
@@ -7,17 +7,18 @@
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
+
#ifndef JSON_LIB_H_
#define JSON_LIB_H_
-typedef VOID* EDKII_JSON_VALUE;
-typedef VOID* EDKII_JSON_ARRAY;
-typedef VOID* EDKII_JSON_OBJECT;
+typedef VOID *EDKII_JSON_VALUE;
+typedef VOID *EDKII_JSON_ARRAY;
+typedef VOID *EDKII_JSON_OBJECT;
///
/// Map to json_int_t in jansson.h
///
-typedef INT64 EDKII_JSON_INT_T; // #JSON_INTEGER_IS_LONG_LONG is set to 1
+typedef INT64 EDKII_JSON_INT_T; // #JSON_INTEGER_IS_LONG_LONG is set to 1
// in jansson_Config.h
///
@@ -25,28 +26,28 @@ typedef INT64 EDKII_JSON_INT_T; // #JSON_INTEGER_IS_LONG_LONG is set to 1
/// See below URI for the JSON encoding flags reference.
/// https://jansson.readthedocs.io/en/2.13/apiref.html#encoding
///
-#define EDKII_JSON_MAX_INDENT 0x1F
-#define EDKII_JSON_INDENT(n) ((n) & EDKII_JSON_MAX_INDENT)
-
-#define EDKII_JSON_COMPACT 0x20
-#define EDKII_JSON_ENSURE_ASCII 0x40
-#define EDKII_JSON_SORT_KEYS 0x80
-#define EDKII_JSON_PRESERVE_ORDER 0x100
-#define EDKII_JSON_ENCODE_ANY 0x200
-#define EDKII_JSON_ESCAPE_SLASH 0x400
-#define EDKII_JSON_REAL_PRECISION(n) (((n) & 0x1F) << 11)
-#define EDKII_JSON_EMBED 0x10000
+#define EDKII_JSON_MAX_INDENT 0x1F
+#define EDKII_JSON_INDENT(n) ((n) & EDKII_JSON_MAX_INDENT)
+
+#define EDKII_JSON_COMPACT 0x20
+#define EDKII_JSON_ENSURE_ASCII 0x40
+#define EDKII_JSON_SORT_KEYS 0x80
+#define EDKII_JSON_PRESERVE_ORDER 0x100
+#define EDKII_JSON_ENCODE_ANY 0x200
+#define EDKII_JSON_ESCAPE_SLASH 0x400
+#define EDKII_JSON_REAL_PRECISION(n) (((n) & 0x1F) << 11)
+#define EDKII_JSON_EMBED 0x10000
///
/// Map to the definitions in jansson.h
/// See below URI for the JSON decoding flags reference.
/// https://jansson.readthedocs.io/en/2.13/apiref.html?highlight=json_loadb#decoding
///
-#define EDKII_JSON_REJECT_DUPLICATES 0x1
-#define EDKII_JSON_DISABLE_EOF_CHECK 0x2
-#define EDKII_JSON_DECODE_ANY 0x4
-#define EDKII_JSON_DECODE_INT_AS_REAL 0x8
-#define EDKII_JSON_ALLOW_NUL 0x10
+#define EDKII_JSON_REJECT_DUPLICATES 0x1
+#define EDKII_JSON_DISABLE_EOF_CHECK 0x2
+#define EDKII_JSON_DECODE_ANY 0x4
+#define EDKII_JSON_DECODE_INT_AS_REAL 0x8
+#define EDKII_JSON_ALLOW_NUL 0x10
#define EDKII_JSON_ARRAY_FOREACH(Array, Index, Value) \
for(Index = 0; \
@@ -63,28 +64,28 @@ typedef INT64 EDKII_JSON_INT_T; // #JSON_INTEGER_IS_LONG_LONG is set to 1
///
/// Map to the json_error_t in jansson.h
///
-#define EDKII_JSON_ERROR_TEXT_LENGTH 160
-#define EDKII_JSON_ERROR_SOURCE_LENGTH 80
+#define EDKII_JSON_ERROR_TEXT_LENGTH 160
+#define EDKII_JSON_ERROR_SOURCE_LENGTH 80
typedef struct {
- INTN Line;
- INTN Column;
- INTN Position;
- CHAR8 Source [EDKII_JSON_ERROR_SOURCE_LENGTH];
- CHAR8 Text [EDKII_JSON_ERROR_TEXT_LENGTH];
+ INTN Line;
+ INTN Column;
+ INTN Position;
+ CHAR8 Source[EDKII_JSON_ERROR_SOURCE_LENGTH];
+ CHAR8 Text[EDKII_JSON_ERROR_TEXT_LENGTH];
} EDKII_JSON_ERROR;
///
/// Map to the json_type in jansson.h
///
typedef enum {
- EdkiiJsonTypeObject,
- EdkiiJsonTypeArray,
- EdkiiJsonTypeString,
- EdkiiJsonTypeInteger,
- EdkiiJsonTypeReal,
- EdkiiJsonTypeTrue,
- EdkiiJsonTypeFalse,
- EdkiiJsonTypeNull
+ EdkiiJsonTypeObject,
+ EdkiiJsonTypeArray,
+ EdkiiJsonTypeString,
+ EdkiiJsonTypeInteger,
+ EdkiiJsonTypeReal,
+ EdkiiJsonTypeTrue,
+ EdkiiJsonTypeFalse,
+ EdkiiJsonTypeNull
} EDKII_JSON_TYPE;
/**
@@ -147,7 +148,7 @@ JsonValueInitObject (
EDKII_JSON_VALUE
EFIAPI
JsonValueInitAsciiString (
- IN CONST CHAR8 *String
+ IN CONST CHAR8 *String
);
/**
@@ -170,7 +171,7 @@ JsonValueInitAsciiString (
EDKII_JSON_VALUE
EFIAPI
JsonValueInitUnicodeString (
- IN CHAR16 *String
+ IN CHAR16 *String
);
/**
@@ -190,7 +191,7 @@ JsonValueInitUnicodeString (
EDKII_JSON_VALUE
EFIAPI
JsonValueInitInteger (
- IN INT64 Value
+ IN INT64 Value
);
/**
@@ -207,7 +208,7 @@ JsonValueInitInteger (
EDKII_JSON_VALUE
EFIAPI
JsonValueInitBoolean (
- IN BOOLEAN Value
+ IN BOOLEAN Value
);
/**
@@ -278,7 +279,7 @@ JsonValueInitFalse (
VOID
EFIAPI
JsonValueFree (
- IN EDKII_JSON_VALUE Json
+ IN EDKII_JSON_VALUE Json
);
/**
@@ -301,7 +302,7 @@ JsonValueFree (
EDKII_JSON_VALUE
EFIAPI
JsonValueClone (
- IN EDKII_JSON_VALUE Json
+ IN EDKII_JSON_VALUE Json
);
/**
@@ -316,7 +317,7 @@ JsonValueClone (
BOOLEAN
EFIAPI
JsonValueIsArray (
- IN EDKII_JSON_VALUE Json
+ IN EDKII_JSON_VALUE Json
);
/**
@@ -331,7 +332,7 @@ JsonValueIsArray (
BOOLEAN
EFIAPI
JsonValueIsObject (
- IN EDKII_JSON_VALUE Json
+ IN EDKII_JSON_VALUE Json
);
/**
@@ -347,7 +348,7 @@ JsonValueIsObject (
BOOLEAN
EFIAPI
JsonValueIsString (
- IN EDKII_JSON_VALUE Json
+ IN EDKII_JSON_VALUE Json
);
/**
@@ -362,7 +363,7 @@ JsonValueIsString (
BOOLEAN
EFIAPI
JsonValueIsInteger (
- IN EDKII_JSON_VALUE Json
+ IN EDKII_JSON_VALUE Json
);
/**
@@ -377,7 +378,7 @@ JsonValueIsInteger (
BOOLEAN
EFIAPI
JsonValueIsNumber (
- IN EDKII_JSON_VALUE Json
+ IN EDKII_JSON_VALUE Json
);
/**
@@ -392,7 +393,7 @@ JsonValueIsNumber (
BOOLEAN
EFIAPI
JsonValueIsBoolean (
- IN EDKII_JSON_VALUE Json
+ IN EDKII_JSON_VALUE Json
);
/**
@@ -407,7 +408,7 @@ JsonValueIsBoolean (
BOOLEAN
EFIAPI
JsonValueIsTrue (
- IN EDKII_JSON_VALUE Json
+ IN EDKII_JSON_VALUE Json
);
/**
@@ -422,7 +423,7 @@ JsonValueIsTrue (
BOOLEAN
EFIAPI
JsonValueIsFalse (
- IN EDKII_JSON_VALUE Json
+ IN EDKII_JSON_VALUE Json
);
/**
@@ -437,7 +438,7 @@ JsonValueIsFalse (
BOOLEAN
EFIAPI
JsonValueIsNull (
- IN EDKII_JSON_VALUE Json
+ IN EDKII_JSON_VALUE Json
);
/**
@@ -453,7 +454,7 @@ JsonValueIsNull (
EDKII_JSON_ARRAY
EFIAPI
JsonValueGetArray (
- IN EDKII_JSON_VALUE Json
+ IN EDKII_JSON_VALUE Json
);
/**
@@ -469,7 +470,7 @@ JsonValueGetArray (
EDKII_JSON_OBJECT
EFIAPI
JsonValueGetObject (
- IN EDKII_JSON_VALUE Json
+ IN EDKII_JSON_VALUE Json
);
/**
@@ -485,7 +486,7 @@ JsonValueGetObject (
CONST CHAR8 *
EFIAPI
JsonValueGetAsciiString (
- IN EDKII_JSON_VALUE Json
+ IN EDKII_JSON_VALUE Json
);
/**
@@ -499,10 +500,10 @@ JsonValueGetAsciiString (
@retval Return the associated Unicode string in JSON value or NULL.
**/
-CHAR16*
+CHAR16 *
EFIAPI
JsonValueGetUnicodeString (
- IN EDKII_JSON_VALUE Json
+ IN EDKII_JSON_VALUE Json
);
/**
@@ -519,7 +520,7 @@ JsonValueGetUnicodeString (
INT64
EFIAPI
JsonValueGetInteger (
- IN EDKII_JSON_VALUE Json
+ IN EDKII_JSON_VALUE Json
);
/**
@@ -536,7 +537,7 @@ JsonValueGetInteger (
BOOLEAN
EFIAPI
JsonValueGetBoolean (
- IN EDKII_JSON_VALUE Json
+ IN EDKII_JSON_VALUE Json
);
/**
@@ -549,10 +550,10 @@ JsonValueGetBoolean (
@retval Return the associated Ascii string in JSON value or NULL on errors.
**/
-CONST CHAR8*
+CONST CHAR8 *
EFIAPI
JsonValueGetString (
- IN EDKII_JSON_VALUE Json
+ IN EDKII_JSON_VALUE Json
);
/**
@@ -567,7 +568,7 @@ JsonValueGetString (
UINTN
EFIAPI
JsonObjectSize (
- IN EDKII_JSON_OBJECT JsonObject
+ IN EDKII_JSON_OBJECT JsonObject
);
/**
@@ -583,10 +584,10 @@ JsonObjectSize (
JsonObj is not an JSON object, key count is zero or on other errors.
**/
-CHAR8**
+CHAR8 **
JsonObjectGetKeys (
- IN EDKII_JSON_OBJECT JsonObj,
- OUT UINTN *KeyCount
+ IN EDKII_JSON_OBJECT JsonObj,
+ OUT UINTN *KeyCount
);
/**
@@ -608,8 +609,8 @@ JsonObjectGetKeys (
EDKII_JSON_VALUE
EFIAPI
JsonObjectGetValue (
- IN CONST EDKII_JSON_OBJECT JsonObj,
- IN CONST CHAR8 *Key
+ IN CONST EDKII_JSON_OBJECT JsonObj,
+ IN CONST CHAR8 *Key
);
/**
@@ -633,9 +634,9 @@ JsonObjectGetValue (
EFI_STATUS
EFIAPI
JsonObjectSetValue (
- IN EDKII_JSON_OBJECT JsonObj,
- IN CONST CHAR8 *Key,
- IN EDKII_JSON_VALUE Json
+ IN EDKII_JSON_OBJECT JsonObj,
+ IN CONST CHAR8 *Key,
+ IN EDKII_JSON_VALUE Json
);
/**
@@ -650,7 +651,7 @@ JsonObjectSetValue (
UINTN
EFIAPI
JsonArrayCount (
- IN EDKII_JSON_ARRAY JsonArray
+ IN EDKII_JSON_ARRAY JsonArray
);
/**
@@ -672,8 +673,8 @@ JsonArrayCount (
EDKII_JSON_VALUE
EFIAPI
JsonArrayGetValue (
- IN EDKII_JSON_ARRAY JsonArray,
- IN UINTN Index
+ IN EDKII_JSON_ARRAY JsonArray,
+ IN UINTN Index
);
/**
@@ -692,8 +693,8 @@ JsonArrayGetValue (
EFI_STATUS
EFIAPI
JsonArrayAppendValue (
- IN EDKII_JSON_ARRAY JsonArray,
- IN EDKII_JSON_VALUE Json
+ IN EDKII_JSON_ARRAY JsonArray,
+ IN EDKII_JSON_VALUE Json
);
/**
@@ -713,8 +714,8 @@ JsonArrayAppendValue (
EFI_STATUS
EFIAPI
JsonArrayRemoveValue (
- IN EDKII_JSON_ARRAY JsonArray,
- IN UINTN Index
+ IN EDKII_JSON_ARRAY JsonArray,
+ IN UINTN Index
);
/**
@@ -742,8 +743,8 @@ JsonArrayRemoveValue (
CHAR8 *
EFIAPI
JsonDumpString (
- IN EDKII_JSON_VALUE JsonValue,
- IN UINTN Flags
+ IN EDKII_JSON_VALUE JsonValue,
+ IN UINTN Flags
);
/**
@@ -766,9 +767,9 @@ JsonDumpString (
EDKII_JSON_VALUE
EFIAPI
JsonLoadString (
- IN CONST CHAR8* String,
- IN UINT64 Flags,
- IN EDKII_JSON_ERROR *Error
+ IN CONST CHAR8 *String,
+ IN UINT64 Flags,
+ IN EDKII_JSON_ERROR *Error
);
/**
@@ -793,7 +794,7 @@ JsonLoadString (
EDKII_JSON_VALUE
EFIAPI
JsonLoadBuffer (
- IN CONST CHAR8 *Buffer,
+ IN CONST CHAR8 *Buffer,
IN UINTN BufferLen,
IN UINTN Flags,
IN OUT EDKII_JSON_ERROR *Error
@@ -815,7 +816,7 @@ JsonLoadBuffer (
VOID
EFIAPI
JsonDecreaseReference (
- IN EDKII_JSON_VALUE JsonValue
+ IN EDKII_JSON_VALUE JsonValue
);
/**
@@ -833,8 +834,9 @@ JsonDecreaseReference (
EDKII_JSON_VALUE
EFIAPI
JsonIncreaseReference (
- IN EDKII_JSON_VALUE JsonValue
+ IN EDKII_JSON_VALUE JsonValue
);
+
/**
Returns an opaque iterator which can be used to iterate over all key-value pairs
in object, or NULL if object is empty
@@ -844,7 +846,7 @@ JsonIncreaseReference (
VOID *
EFIAPI
JsonObjectIterator (
- IN EDKII_JSON_VALUE JsonValue
+ IN EDKII_JSON_VALUE JsonValue
);
/**
@@ -855,7 +857,7 @@ JsonObjectIterator (
EDKII_JSON_VALUE
EFIAPI
JsonObjectIteratorValue (
- IN VOID *Iterator
+ IN VOID *Iterator
);
/**
@@ -869,8 +871,8 @@ JsonObjectIteratorValue (
VOID *
EFIAPI
JsonObjectIteratorNext (
- IN EDKII_JSON_VALUE JsonValue,
- IN VOID *Iterator
+ IN EDKII_JSON_VALUE JsonValue,
+ IN VOID *Iterator
);
/**
@@ -882,8 +884,8 @@ JsonObjectIteratorNext (
CHAR8 *
EFIAPI
JsonObjectIteratorKey (
- IN VOID *Iterator
-);
+ IN VOID *Iterator
+ );
/**
Returns the pointer of iterator by key.
@@ -894,8 +896,8 @@ JsonObjectIteratorKey (
VOID *
EFIAPI
JsonObjectKeyToIterator (
- IN CHAR8 *Key
-);
+ IN CHAR8 *Key
+ );
/**
Returns the json type of this json value
@@ -905,7 +907,8 @@ JsonObjectKeyToIterator (
**/
EDKII_JSON_TYPE
EFIAPI
-JsonGetType(
- IN EDKII_JSON_VALUE JsonValue
+JsonGetType (
+ IN EDKII_JSON_VALUE JsonValue
);
+
#endif
diff --git a/RedfishPkg/Include/Library/RedfishContentCodingLib.h b/RedfishPkg/Include/Library/RedfishContentCodingLib.h
index 71a8adc..137c39a 100644
--- a/RedfishPkg/Include/Library/RedfishContentCodingLib.h
+++ b/RedfishPkg/Include/Library/RedfishContentCodingLib.h
@@ -6,6 +6,7 @@
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
+
#ifndef REDFISH_CONTENT_CODING_LIB_H_
#define REDFISH_CONTENT_CODING_LIB_H_
@@ -36,11 +37,11 @@
EFI_STATUS
RedfishContentEncode (
- IN CHAR8 *ContentEncodedValue,
- IN CHAR8 *OriginalContent,
- IN UINTN OriginalContentLength,
- OUT VOID **EncodedContentPointer,
- OUT UINTN *EncodedLength
+ IN CHAR8 *ContentEncodedValue,
+ IN CHAR8 *OriginalContent,
+ IN UINTN OriginalContentLength,
+ OUT VOID **EncodedContentPointer,
+ OUT UINTN *EncodedLength
);
/**
@@ -69,10 +70,11 @@ RedfishContentEncode (
**/
EFI_STATUS
RedfishContentDecode (
- IN CHAR8 *ContentEncodedValue,
- IN VOID *ContentPointer,
- IN UINTN ContentLength,
- OUT VOID **DecodedContentPointer,
- OUT UINTN *DecodedLength
+ IN CHAR8 *ContentEncodedValue,
+ IN VOID *ContentPointer,
+ IN UINTN ContentLength,
+ OUT VOID **DecodedContentPointer,
+ OUT UINTN *DecodedLength
);
+
#endif
diff --git a/RedfishPkg/Include/Library/RedfishCredentialLib.h b/RedfishPkg/Include/Library/RedfishCredentialLib.h
index dac1b33..fafe786 100644
--- a/RedfishPkg/Include/Library/RedfishCredentialLib.h
+++ b/RedfishPkg/Include/Library/RedfishCredentialLib.h
@@ -6,6 +6,7 @@
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
+
#ifndef REDFISH_CREDENTIAL_LIB_H_
#define REDFISH_CREDENTIAL_LIB_H_
@@ -20,7 +21,7 @@ VOID
EFIAPI
LibCredentialExitBootServicesNotify (
IN EDKII_REDFISH_CREDENTIAL_PROTOCOL *This
-);
+ );
/**
Notification of End of DXe.
@@ -31,7 +32,7 @@ VOID
EFIAPI
LibCredentialEndOfDxeNotify (
IN EDKII_REDFISH_CREDENTIAL_PROTOCOL *This
-);
+ );
/**
Retrieve platform's Redfish authentication information.
@@ -64,7 +65,7 @@ LibCredentialGetAuthInfo (
OUT EDKII_REDFISH_AUTH_METHOD *AuthMethod,
OUT CHAR8 **UserId,
OUT CHAR8 **Password
-);
+ );
/**
Notify the Redfish service provide to stop provide configuration service to this platform.
@@ -85,7 +86,8 @@ LibCredentialGetAuthInfo (
EFI_STATUS
EFIAPI
LibStopRedfishService (
- IN EDKII_REDFISH_CREDENTIAL_PROTOCOL *This,
- IN EDKII_REDFISH_CREDENTIAL_STOP_SERVICE_TYPE ServiceStopType
-);
+ IN EDKII_REDFISH_CREDENTIAL_PROTOCOL *This,
+ IN EDKII_REDFISH_CREDENTIAL_STOP_SERVICE_TYPE ServiceStopType
+ );
+
#endif
diff --git a/RedfishPkg/Include/Library/RedfishCrtLib.h b/RedfishPkg/Include/Library/RedfishCrtLib.h
index 5e15768..23c6acf 100644
--- a/RedfishPkg/Include/Library/RedfishCrtLib.h
+++ b/RedfishPkg/Include/Library/RedfishCrtLib.h
@@ -19,74 +19,76 @@
#define MAX_STRING_SIZE 0x10000000
// Minimum value for an object of type long long int.
-#define LLONG_MIN MIN_INT64
+#define LLONG_MIN MIN_INT64
// Maximum value for an object of type long long int.
-#define LLONG_MAX MAX_INT64
+#define LLONG_MAX MAX_INT64
// We dont support double on edk2
-#define HUGE_VAL 0
+#define HUGE_VAL 0
-#if defined(MDE_CPU_X64) || defined(MDE_CPU_AARCH64) || defined(MDE_CPU_RISCV64)
+#if defined (MDE_CPU_X64) || defined (MDE_CPU_AARCH64) || defined (MDE_CPU_RISCV64)
//
// With GCC we would normally use SIXTY_FOUR_BIT_LONG, but MSVC needs
// SIXTY_FOUR_BIT, because 'long' is 32-bit and only 'long long' is
// 64-bit. Since using 'long long' works fine on GCC too, just do that.
//
#define SIXTY_FOUR_BIT
-#elif defined(MDE_CPU_IA32) || defined(MDE_CPU_ARM) || defined(MDE_CPU_EBC)
+#elif defined (MDE_CPU_IA32) || defined (MDE_CPU_ARM) || defined (MDE_CPU_EBC)
#define THIRTY_TWO_BIT
#endif
//
// Map all va_xxxx elements to VA_xxx defined in MdePkg/Include/Base.h
//
-#if !defined(__CC_ARM) // if va_list is not already defined
+#if !defined (__CC_ARM) // if va_list is not already defined
#define va_list VA_LIST
#define va_arg VA_ARG
#define va_start VA_START
#define va_end VA_END
#else // __CC_ARM
-#define va_start(Marker, Parameter) __va_start(Marker, Parameter)
-#define va_arg(Marker, TYPE) __va_arg(Marker, TYPE)
-#define va_end(Marker) ((void)0)
+#define va_start(Marker, Parameter) __va_start(Marker, Parameter)
+#define va_arg(Marker, TYPE) __va_arg(Marker, TYPE)
+#define va_end(Marker) ((void)0)
#endif
//
// Definitions for global constants used by CRT library routines
//
-#define INT_MAX MAX_INT32 /* Maximum (signed) int value */
-#define LONG_MAX 0X7FFFFFFFL /* max value for a long */
-#define LONG_MIN (-LONG_MAX-1) /* min value for a long */
-#define ULONG_MAX 0xFFFFFFFF /* Maximum unsigned long value */
-#define CHAR_BIT 8 /* Number of bits in a char */
+#define INT_MAX MAX_INT32 /* Maximum (signed) int value */
+#define LONG_MAX 0X7FFFFFFFL /* max value for a long */
+#define LONG_MIN (-LONG_MAX-1) /* min value for a long */
+#define ULONG_MAX 0xFFFFFFFF /* Maximum unsigned long value */
+#define CHAR_BIT 8 /* Number of bits in a char */
// Maximum value for an object of type unsigned long long int.
#define ULLONG_MAX 0xFFFFFFFFFFFFFFFFULL // 2^64 - 1
// Maximum value for an object of type unsigned char.
-#define UCHAR_MAX 255 // 2^8 - 1
+#define UCHAR_MAX 255 // 2^8 - 1
//
// Basic types mapping
//
-typedef UINTN size_t;
-typedef INTN ssize_t;
-typedef INT32 time_t;
-typedef UINT8 __uint8_t;
-typedef UINT8 sa_family_t;
-typedef UINT32 uid_t;
-typedef UINT32 gid_t;
-typedef INT32 int32_t;
-typedef UINT32 uint32_t;
-typedef UINT16 uint16_t;
-typedef UINT8 uint8_t;
-typedef enum {false, true} bool;
+typedef UINTN size_t;
+typedef INTN ssize_t;
+typedef INT32 time_t;
+typedef UINT8 __uint8_t;
+typedef UINT8 sa_family_t;
+typedef UINT32 uid_t;
+typedef UINT32 gid_t;
+typedef INT32 int32_t;
+typedef UINT32 uint32_t;
+typedef UINT16 uint16_t;
+typedef UINT8 uint8_t;
+typedef enum {
+ false, true
+} bool;
//
// File operations are not required for EFI building,
// so FILE is mapped to VOID * to pass build
//
-typedef VOID *FILE;
+typedef VOID *FILE;
/**
This is the Redfish version of CRT snprintf function, this function replaces "%s" to
@@ -133,110 +135,406 @@ RedfishAsciiSPrint (
UINTN
EFIAPI
RedfishAsciiVSPrint (
- OUT CHAR8 *StartOfBuffer,
- IN UINTN BufferSize,
- IN CONST CHAR8 *FormatString,
- IN VA_LIST Marker
+ OUT CHAR8 *StartOfBuffer,
+ IN UINTN BufferSize,
+ IN CONST CHAR8 *FormatString,
+ IN VA_LIST Marker
);
//
// Global variables
//
-extern int errno;
-extern FILE *stderr;
+extern int errno;
+extern FILE *stderr;
//
// Function prototypes of CRT Library routines
//
-void *malloc (size_t);
-void *realloc (void *, size_t);
-void *calloc (size_t Num, size_t Size);
-void free (void *);
-void *memset (void *, int, size_t);
-int memcmp (const void *, const void *, size_t);
-int isdigit (int);
-int isspace (int);
-int tolower (int);
-int isupper (int);
-int isxdigit (int);
-int isalnum (int);
-void *memcpy (void *, const void *, size_t);
-void *memset (void *, int, size_t);
-void *memchr (const void *, int, size_t);
-int memcmp (const void *, const void *, size_t);
-void *memmove (void *, const void *, size_t);
-int strcmp (const char *, const char *);
-int strncmp (const char *, const char *, size_t);
-char *strcpy (char *, const char *);
-size_t strlen (const char *);
-char *strcat (char *, const char *);
-char *strchr (const char *, int);
-int strcasecmp (const char *, const char *);
-int strncasecmp (const char *, const char *, size_t);
-char *strncpy (char *, size_t, const char *, size_t);
-int strncmp (const char *, const char *, size_t);
-char *strrchr (const char *, int);
-unsigned long strtoul (const char *, char **, int);
-char * strstr (const char *s1 , const char *s2);
-long strtol (const char *, char **, int);
-char *strerror (int);
-size_t strspn (const char *, const char *);
-char * strdup (const char *str);
-char * strpbrk (const char *s1, const char *s2);
-unsigned long long strtoull(const char * nptr, char ** endptr, int base);
-long long strtoll (const char * nptr, char ** endptr, int base);
-long strtol (const char * nptr, char ** endptr, int base);
-double strtod (const char * __restrict nptr, char ** __restrict endptr);
-size_t strcspn (const char *, const char *);
-int printf (const char *, ...);
-int sscanf (const char *, const char *, ...);
-FILE *fopen (const char *, const char *);
-size_t fread (void *, size_t, size_t, FILE *);
-size_t fwrite (const void *, size_t, size_t, FILE *);
-int fclose (FILE *);
-int fprintf (FILE *, const char *, ...);
-int fgetc (FILE * _File);
-uid_t getuid (void);
-uid_t geteuid (void);
-gid_t getgid (void);
-gid_t getegid (void);
-void qsort (void *, size_t, size_t, int (*)(const void *, const void *));
-char *getenv (const char *);
-#if defined(__GNUC__) && (__GNUC__ >= 2)
-void abort (void) __attribute__((__noreturn__));
+void *
+malloc (
+ size_t
+ );
+
+void *
+realloc (
+ void *,
+ size_t
+ );
+
+void *
+calloc (
+ size_t Num,
+ size_t Size
+ );
+
+void
+free (
+ void *
+ );
+
+void *
+memset (
+ void *,
+ int,
+ size_t
+ );
+
+int
+memcmp (
+ const void *,
+ const void *,
+ size_t
+ );
+
+int
+isdigit (
+ int
+ );
+
+int
+isspace (
+ int
+ );
+
+int
+tolower (
+ int
+ );
+
+int
+isupper (
+ int
+ );
+
+int
+isxdigit (
+ int
+ );
+
+int
+isalnum (
+ int
+ );
+
+void *
+memcpy (
+ void *,
+ const void *,
+ size_t
+ );
+
+void *
+memset (
+ void *,
+ int,
+ size_t
+ );
+
+void *
+memchr (
+ const void *,
+ int,
+ size_t
+ );
+
+int
+memcmp (
+ const void *,
+ const void *,
+ size_t
+ );
+
+void *
+memmove (
+ void *,
+ const void *,
+ size_t
+ );
+
+int
+strcmp (
+ const char *,
+ const char *
+ );
+
+int
+strncmp (
+ const char *,
+ const char *,
+ size_t
+ );
+
+char *
+strcpy (
+ char *,
+ const char *
+ );
+
+size_t
+strlen (
+ const char *
+ );
+
+char *
+strcat (
+ char *,
+ const char *
+ );
+
+char *
+strchr (
+ const char *,
+ int
+ );
+
+int
+strcasecmp (
+ const char *,
+ const char *
+ );
+
+int
+strncasecmp (
+ const char *,
+ const char *,
+ size_t
+ );
+
+char *
+strncpy (
+ char *,
+ size_t,
+ const char *,
+ size_t
+ );
+
+int
+strncmp (
+ const char *,
+ const char *,
+ size_t
+ );
+
+char *
+strrchr (
+ const char *,
+ int
+ );
+
+unsigned long
+strtoul (
+ const char *,
+ char **,
+ int
+ );
+
+char *
+strstr (
+ const char *s1,
+ const char *s2
+ );
+
+long
+strtol (
+ const char *,
+ char **,
+ int
+ );
+
+char *
+strerror (
+ int
+ );
+
+size_t
+strspn (
+ const char *,
+ const char *
+ );
+
+char *
+strdup (
+ const char *str
+ );
+
+char *
+strpbrk (
+ const char *s1,
+ const char *s2
+ );
+
+unsigned long long
+strtoull (
+ const char *nptr,
+ char **endptr,
+ int base
+ );
+
+long long
+strtoll (
+ const char *nptr,
+ char **endptr,
+ int base
+ );
+
+long
+strtol (
+ const char *nptr,
+ char **endptr,
+ int base
+ );
+
+double
+strtod (
+ const char *__restrict nptr,
+ char **__restrict endptr
+ );
+
+size_t
+strcspn (
+ const char *,
+ const char *
+ );
+
+int
+printf (
+ const char *,
+ ...
+ );
+
+int
+sscanf (
+ const char *,
+ const char *,
+ ...
+ );
+
+FILE *
+fopen (
+ const char *,
+ const char *
+ );
+
+size_t
+fread (
+ void *,
+ size_t,
+ size_t,
+ FILE *
+ );
+
+size_t
+fwrite (
+ const void *,
+ size_t,
+ size_t,
+ FILE *
+ );
+
+int
+fclose (
+ FILE *
+ );
+
+int
+fprintf (
+ FILE *,
+ const char *,
+ ...
+ );
+
+int
+fgetc (
+ FILE *_File
+ );
+
+uid_t
+getuid (
+ void
+ );
+
+uid_t
+geteuid (
+ void
+ );
+
+gid_t
+getgid (
+ void
+ );
+
+gid_t
+getegid (
+ void
+ );
+
+void
+qsort (
+ void *,
+ size_t,
+ size_t,
+ int (*)(const void *, const void *)
+ );
+
+char *
+getenv (
+ const char *
+ );
+
+#if defined (__GNUC__) && (__GNUC__ >= 2)
+void
+abort (
+ void
+ ) __attribute__ ((__noreturn__));
+
#else
-void abort (void);
+void
+abort (
+ void
+ );
+
#endif
-int toupper (int);
-int Digit2Val (int);
-time_t time (time_t *);
+int
+toupper (
+ int
+ );
+
+int
+Digit2Val (
+ int
+ );
+
+time_t
+time (
+ time_t *
+ );
//
// Macros that directly map functions to BaseLib, BaseMemoryLib, and DebugLib functions
//
-#define strcmp AsciiStrCmp
-#define memcpy(dest,source,count) CopyMem(dest,source,(UINTN)(count))
-#define memset(dest,ch,count) SetMem(dest,(UINTN)(count),(UINT8)(ch))
-#define memchr(buf,ch,count) ScanMem8(buf,(UINTN)(count),(UINT8)ch)
-#define memcmp(buf1,buf2,count) (int)(CompareMem(buf1,buf2,(UINTN)(count)))
-#define memmove(dest,source,count) CopyMem(dest,source,(UINTN)(count))
-#define strlen(str) (size_t)(AsciiStrnLenS(str,MAX_STRING_SIZE))
-#define strcpy(strDest,strSource) AsciiStrCpyS(strDest,(strlen(strSource)+1),strSource)
-#define strncpy(strDest,strSource,count) AsciiStrnCpyS(strDest,(UINTN)count,strSource,(UINTN)count)
-#define strncpys(strDest, DestLen, strSource,count) AsciiStrnCpyS(strDest,DestLen,strSource,(UINTN)count)
-#define strcat(strDest,strSource) AsciiStrCatS(strDest,(strlen(strSource)+strlen(strDest)+1),strSource)
-#define strchr(str,ch) ScanMem8((VOID *)(str),AsciiStrSize(str),(UINT8)ch)
-#define strcasecmp(str1,str2) (int)AsciiStriCmp(str1,str2)
-#define strstr(s1,s2) AsciiStrStr(s1,s2)
-#define snprintf(buf,len,...) RedfishAsciiSPrint(buf,len,__VA_ARGS__)
-#define vsnprintf(buf,len,format,marker) RedfishAsciiVSPrint((buf),(len),(format),(marker))
-#define assert(expression) ASSERT(expression)
-#define offsetof(type,member) OFFSET_OF(type,member)
-
-#define EOF (-1)
+#define strcmp AsciiStrCmp
+#define memcpy(dest, source, count) CopyMem(dest,source,(UINTN)(count))
+#define memset(dest, ch, count) SetMem(dest,(UINTN)(count),(UINT8)(ch))
+#define memchr(buf, ch, count) ScanMem8(buf,(UINTN)(count),(UINT8)ch)
+#define memcmp(buf1, buf2, count) (int)(CompareMem(buf1,buf2,(UINTN)(count)))
+#define memmove(dest, source, count) CopyMem(dest,source,(UINTN)(count))
+#define strlen(str) (size_t)(AsciiStrnLenS(str,MAX_STRING_SIZE))
+#define strcpy(strDest, strSource) AsciiStrCpyS(strDest,(strlen(strSource)+1),strSource)
+#define strncpy(strDest, strSource, count) AsciiStrnCpyS(strDest,(UINTN)count,strSource,(UINTN)count)
+#define strncpys(strDest, DestLen, strSource, count) AsciiStrnCpyS(strDest,DestLen,strSource,(UINTN)count)
+#define strcat(strDest, strSource) AsciiStrCatS(strDest,(strlen(strSource)+strlen(strDest)+1),strSource)
+#define strchr(str, ch) ScanMem8((VOID *)(str),AsciiStrSize(str),(UINT8)ch)
+#define strcasecmp(str1, str2) (int)AsciiStriCmp(str1,str2)
+#define strstr(s1, s2) AsciiStrStr(s1,s2)
+#define snprintf(buf, len, ...) RedfishAsciiSPrint(buf,len,__VA_ARGS__)
+#define vsnprintf(buf, len, format, marker) RedfishAsciiVSPrint((buf),(len),(format),(marker))
+#define assert(expression) ASSERT(expression)
+#define offsetof(type, member) OFFSET_OF(type,member)
+
+#define EOF (-1)
extern int errno;
-#define ERANGE 34 /* 34 Result too large */
+#define ERANGE 34 /* 34 Result too large */
#endif
diff --git a/RedfishPkg/Include/Library/RedfishHostInterfaceLib.h b/RedfishPkg/Include/Library/RedfishHostInterfaceLib.h
index ad134e8..8d8389b 100644
--- a/RedfishPkg/Include/Library/RedfishHostInterfaceLib.h
+++ b/RedfishPkg/Include/Library/RedfishHostInterfaceLib.h
@@ -6,6 +6,7 @@
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
+
#ifndef REDFISH_HOST_INTERFACE_LIB_H_
#define REDFISH_HOST_INTERFACE_LIB_H_
@@ -27,9 +28,10 @@
**/
EFI_STATUS
RedfishPlatformHostInterfaceDeviceDescriptor (
- IN UINT8 *DeviceType,
+ IN UINT8 *DeviceType,
OUT REDFISH_INTERFACE_DATA **DeviceDescriptor
-);
+ );
+
/**
Get platform Redfish host interface protocol data.
Caller should pass NULL in ProtocolRecord to retrive the first protocol record.
@@ -46,7 +48,8 @@ RedfishPlatformHostInterfaceDeviceDescriptor (
**/
EFI_STATUS
RedfishPlatformHostInterfaceProtocolData (
- IN OUT MC_HOST_INTERFACE_PROTOCOL_RECORD **ProtocolRecord,
- IN UINT8 IndexOfProtocolData
-);
+ IN OUT MC_HOST_INTERFACE_PROTOCOL_RECORD **ProtocolRecord,
+ IN UINT8 IndexOfProtocolData
+ );
+
#endif
diff --git a/RedfishPkg/Include/Library/RestExLib.h b/RedfishPkg/Include/Library/RestExLib.h
index 80233fb..bc4e4ca 100644
--- a/RedfishPkg/Include/Library/RestExLib.h
+++ b/RedfishPkg/Include/Library/RestExLib.h
@@ -32,11 +32,11 @@
**/
EFI_STATUS
RestExLibCreateChild (
- IN EFI_HANDLE Image,
+ IN EFI_HANDLE Image,
IN EFI_REST_EX_SERVICE_ACCESS_MODE AccessMode,
- IN EFI_REST_EX_CONFIG_TYPE ConfigType,
- IN EFI_REST_EX_SERVICE_TYPE ServiceType,
- OUT EFI_HANDLE *ChildInstanceHandle
-);
+ IN EFI_REST_EX_CONFIG_TYPE ConfigType,
+ IN EFI_REST_EX_SERVICE_TYPE ServiceType,
+ OUT EFI_HANDLE *ChildInstanceHandle
+ );
#endif