Pulsar
3d3a057
|
Base types. More...
#include <switch.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#include <unistd.h>
Go to the source code of this file.
Macros | |
#define | PLSR_RC_MAKE_RESULT_TYPE(RESULT_TYPE) (PLSR_ResultType_ ## RESULT_TYPE) |
Shortcut to get a result type enum from its name. | |
#define | PLSR_RC_MAKE_CATEGORY_TYPE(ARCHIVE_TYPE, CATEGORY_TYPE) (PLSR_ ## ARCHIVE_TYPE ## CategoryType_ ## CATEGORY_TYPE) |
Shortcut to get a category enum from its name. | |
#define | PLSR_RC_MAKE_ARCHIVE_TYPE(ARCHIVE_TYPE) (PLSR_ArchiveType_ ## ARCHIVE_TYPE) |
Shortcut to get an archive enum from its name. | |
#define | PLSR_RC_MAKE_RAW(ARCHIVE, CATEGORY, RESULT) (RESULT + (CATEGORY << 8) + (ARCHIVE << 16)) |
Make a result code from raw integers. | |
#define | PLSR_RC_MAKE(ARCHIVE_TYPE, CATEGORY_TYPE, RESULT_TYPE) |
Make a result code from archive, category and result type names. More... | |
#define | PLSR_RC_OK 0 |
Result code returned on success. | |
#define | PLSR_RC_FAILED(RESULT) (RESULT != PLSR_RC_OK) |
Test that the result code means failure. | |
#define | PLSR_RC_SUCCEEDED(RESULT) (RESULT == PLSR_RC_OK) |
Test that the result code means success. | |
#define | PLSR_RC_ARCHIVE(RESULT) ((RESULT >> 16) & 0xFF) |
Extract the archive part of a result code. | |
#define | PLSR_RC_CATEGORY(RESULT) ((RESULT >> 8) & 0xFF) |
Extract the category part of a result code. | |
#define | PLSR_RC_RESULT(RESULT) (RESULT & 0xFF) |
Extract the result type part of a result code. | |
#define | PLSR_RC_CONVERT(RESULT, NEW_ARCHIVE_TYPE, NEW_CATEGORY_TYPE) |
Convert a result code to another archive and category, keeping the result type. More... | |
#define | PLSR_RC_TRY(X) |
Return result code if failed. More... | |
#define | PLSR_RC_LTRY(ARCHIVE_TYPE, CATEGORY_TYPE, X) |
Return result code if failed, also converts result to a new archive and category. More... | |
#define | PLSR_RC_NX_LTRY(ARCHIVE_TYPE, CATEGORY_TYPE, NX_RESULT) |
Return a System type result code if the libnx result failed. More... | |
Typedefs | |
typedef u32 | PLSR_RC |
Result code returned by Pulsar functions. | |
Enumerations | |
enum | PLSR_ResultType { PLSR_ResultType_OK = 0, PLSR_ResultType_FileRead, PLSR_ResultType_BadMagic, PLSR_ResultType_BadEndianness, PLSR_ResultType_BadInput, PLSR_ResultType_NotFound, PLSR_ResultType_NotReady, PLSR_ResultType_Unsupported, PLSR_ResultType_Memory, PLSR_ResultType_System = 0xFF } |
Result code types. More... | |
enum | PLSR_ArchiveType { PLSR_ArchiveType_Unknown = 0, PLSR_ArchiveType_BFSAR, PLSR_ArchiveType_BFGRP, PLSR_ArchiveType_BFWSD, PLSR_ArchiveType_BFWAR, PLSR_ArchiveType_BFWAV, PLSR_ArchiveType_BFSTM, PLSR_ArchiveType_Player = 0xFF } |
Supported archive types. More... | |
Base types.
#define PLSR_RC_CONVERT | ( | RESULT, | |
NEW_ARCHIVE_TYPE, | |||
NEW_CATEGORY_TYPE | |||
) |
Convert a result code to another archive and category, keeping the result type.
#define PLSR_RC_LTRY | ( | ARCHIVE_TYPE, | |
CATEGORY_TYPE, | |||
X | |||
) |
Return result code if failed, also converts result to a new archive and category.
#define PLSR_RC_MAKE | ( | ARCHIVE_TYPE, | |
CATEGORY_TYPE, | |||
RESULT_TYPE | |||
) |
Make a result code from archive, category and result type names.
#define PLSR_RC_NX_LTRY | ( | ARCHIVE_TYPE, | |
CATEGORY_TYPE, | |||
NX_RESULT | |||
) |
Return a System type result code if the libnx result failed.
#define PLSR_RC_TRY | ( | X | ) |
Return result code if failed.
enum PLSR_ArchiveType |
Supported archive types.
enum PLSR_ResultType |
Result code types.