*/\r
typedef struct AmlStream {\r
/// Pointer to a buffer.\r
- UINT8 * Buffer;\r
+ UINT8 *Buffer;\r
\r
/// Size of Buffer.\r
- UINT32 MaxBufferSize;\r
+ UINT32 MaxBufferSize;\r
\r
/// Index in the Buffer.\r
/// The Index field allows to keep track of how many bytes have been\r
/// read/written in the Buffer, and to retrieve the current stream position.\r
/// 0 <= Index <= MaxBufferSize.\r
/// If Index == MaxBufferSize, no more action is allowed on the stream.\r
- UINT32 Index;\r
+ UINT32 Index;\r
\r
/// The direction the stream is progressing.\r
/// If the stream goes backward (toward lower addresses), the bytes written\r
/// +---------------+-----+-----+-----+-----+-----+-----+---- +------+\r
/// ^\r
/// Current position.\r
- EAML_STREAM_DIRECTION Direction;\r
+ EAML_STREAM_DIRECTION Direction;\r
} AML_STREAM;\r
\r
/** Check whether a StreamPtr is a valid Stream.\r
@retval TRUE Stream goes forward.\r
@retval FALSE Otherwise.\r
*/\r
-#define IS_STREAM_FORWARD(Stream) ( \\r
+#define IS_STREAM_FORWARD(Stream) ( \\r
((AML_STREAM*)Stream)->Direction == EAmlStreamDirectionForward)\r
\r
/** Check Stream goes backward.\r
@retval TRUE Stream goes backward.\r
@retval FALSE Otherwise.\r
*/\r
-#define IS_STREAM_BACKWARD(Stream) ( \\r
+#define IS_STREAM_BACKWARD(Stream) ( \\r
((AML_STREAM*)Stream)->Direction == EAmlStreamDirectionBackward)\r
\r
/** Initialize a stream.\r
EFI_STATUS\r
EFIAPI\r
AmlStreamInit (\r
- IN OUT AML_STREAM * Stream,\r
- IN UINT8 * Buffer,\r
- IN UINT32 MaxBufferSize,\r
- IN EAML_STREAM_DIRECTION Direction\r
+ IN OUT AML_STREAM *Stream,\r
+ IN UINT8 *Buffer,\r
+ IN UINT32 MaxBufferSize,\r
+ IN EAML_STREAM_DIRECTION Direction\r
);\r
\r
/** Clone a stream.\r
EFI_STATUS\r
EFIAPI\r
AmlStreamClone (\r
- IN CONST AML_STREAM * Stream,\r
- OUT AML_STREAM * ClonedStream\r
+ IN CONST AML_STREAM *Stream,\r
+ OUT AML_STREAM *ClonedStream\r
);\r
\r
/** Initialize a sub-stream from a stream.\r
EFI_STATUS\r
EFIAPI\r
AmlStreamInitSubStream (\r
- IN CONST AML_STREAM * Stream,\r
- OUT AML_STREAM * SubStream\r
+ IN CONST AML_STREAM *Stream,\r
+ OUT AML_STREAM *SubStream\r
);\r
\r
/** Get the buffer of a stream.\r
UINT8 *\r
EFIAPI\r
AmlStreamGetBuffer (\r
- IN CONST AML_STREAM * Stream\r
+ IN CONST AML_STREAM *Stream\r
);\r
\r
/** Get the size of Stream's Buffer.\r
UINT32\r
EFIAPI\r
AmlStreamGetMaxBufferSize (\r
- IN CONST AML_STREAM * Stream\r
+ IN CONST AML_STREAM *Stream\r
);\r
\r
/** Reduce the maximal size of Stream's Buffer (MaxBufferSize field).\r
EFI_STATUS\r
EFIAPI\r
AmlStreamReduceMaxBufferSize (\r
- IN AML_STREAM * Stream,\r
- IN UINT32 Diff\r
+ IN AML_STREAM *Stream,\r
+ IN UINT32 Diff\r
);\r
\r
/** Get Stream's Index.\r
UINT32\r
EFIAPI\r
AmlStreamGetIndex (\r
- IN CONST AML_STREAM * Stream\r
+ IN CONST AML_STREAM *Stream\r
);\r
\r
/** Get Stream's Direction.\r
EAML_STREAM_DIRECTION\r
EFIAPI\r
AmlStreamGetDirection (\r
- IN CONST AML_STREAM * Stream\r
+ IN CONST AML_STREAM *Stream\r
);\r
\r
/** Return a pointer to the current position in the stream.\r
UINT8 *\r
EFIAPI\r
AmlStreamGetCurrPos (\r
- IN CONST AML_STREAM * Stream\r
+ IN CONST AML_STREAM *Stream\r
);\r
\r
/** Get the space available in the stream.\r
UINT32\r
EFIAPI\r
AmlStreamGetFreeSpace (\r
- IN CONST AML_STREAM * Stream\r
+ IN CONST AML_STREAM *Stream\r
);\r
\r
/** Move Stream by Offset bytes.\r
EFI_STATUS\r
EFIAPI\r
AmlStreamProgress (\r
- IN AML_STREAM * Stream,\r
- IN UINT32 Offset\r
+ IN AML_STREAM *Stream,\r
+ IN UINT32 Offset\r
);\r
\r
/** Rewind Stream of Offset bytes.\r
EFI_STATUS\r
EFIAPI\r
AmlStreamRewind (\r
- IN AML_STREAM * Stream,\r
- IN UINT32 Offset\r
+ IN AML_STREAM *Stream,\r
+ IN UINT32 Offset\r
);\r
\r
/** Reset the Stream (move the current position to the initial position).\r
EFI_STATUS\r
EFIAPI\r
AmlStreamReset (\r
- IN AML_STREAM * Stream\r
+ IN AML_STREAM *Stream\r
);\r
\r
/** Peek one byte at Stream's current position.\r
EFI_STATUS\r
EFIAPI\r
AmlStreamPeekByte (\r
- IN AML_STREAM * Stream,\r
- OUT UINT8 * OutByte\r
+ IN AML_STREAM *Stream,\r
+ OUT UINT8 *OutByte\r
);\r
\r
/** Read one byte at Stream's current position.\r
EFI_STATUS\r
EFIAPI\r
AmlStreamReadByte (\r
- IN AML_STREAM * Stream,\r
- OUT UINT8 * OutByte\r
+ IN AML_STREAM *Stream,\r
+ OUT UINT8 *OutByte\r
);\r
\r
/** Write Size bytes in the stream.\r
EFI_STATUS\r
EFIAPI\r
AmlStreamWrite (\r
- IN AML_STREAM * Stream,\r
- IN CONST UINT8 * Buffer,\r
- IN UINT32 Size\r
+ IN AML_STREAM *Stream,\r
+ IN CONST UINT8 *Buffer,\r
+ IN UINT32 Size\r
);\r
\r
/** Compare Size bytes between Stream1 and Stream2 from their\r
BOOLEAN\r
EFIAPI\r
AmlStreamCmp (\r
- IN CONST AML_STREAM * Stream1,\r
- IN CONST AML_STREAM * Stream2,\r
- IN UINT32 Size\r
+ IN CONST AML_STREAM *Stream1,\r
+ IN CONST AML_STREAM *Stream2,\r
+ IN UINT32 Size\r
);\r
\r
/** Copy Size bytes of the stream's data to DstBuffer.\r
EFI_STATUS\r
EFIAPI\r
AmlStreamCpyS (\r
- OUT CHAR8 * DstBuffer,\r
- IN UINT32 MaxDstBufferSize,\r
- IN AML_STREAM * Stream,\r
- IN UINT32 Size\r
+ OUT CHAR8 *DstBuffer,\r
+ IN UINT32 MaxDstBufferSize,\r
+ IN AML_STREAM *Stream,\r
+ IN UINT32 Size\r
);\r
\r
#endif // AML_STREAM_H_\r