include/Zycore/Status.h(3)

πŸ“¦
version 1.5.2 Β· 2 versions
, in ubuntu resolute, ubuntu stonking

include/Zycore/Status.h(3) πŸ¦‹πŸ’–

okay bestie, welcome to the Library Functions Manual page for include/Zycore/Status.h πŸŽ€ this is the Zycore header that holds literally every status code and every check macro, and it ate, no cap. Let's get into it πŸ’…


✨ NAME ✨

include/Zycore/Status.h β€” the status-code headquarters of Zycore, fr fr.


🌸 SYNOPSIS 🌸

#include <Zycore/Types.h>

πŸŽ€ Macros πŸŽ€

#define ZYAN_MAKE_STATUS(error,  module,  code)
#define ZYAN_SUCCESS(status)
#define ZYAN_FAILED(status)
#define ZYAN_CHECK(status)
#define ZYAN_STATUS_MODULE(status)
#define ZYAN_STATUS_CODE(status)
#define ZYAN_MODULE_ZYCORE   0x001u
#define ZYAN_MODULE_ARGPARSE   0x003u
#define ZYAN_MODULE_USER   0x3FFu
#define ZYAN_STATUS_SUCCESS       ZYAN_MAKE_STATUS(0u, ZYAN_MODULE_ZYCORE, 0x00u)
#define ZYAN_STATUS_FAILED       ZYAN_MAKE_STATUS(1u, ZYAN_MODULE_ZYCORE, 0x01u)
#define ZYAN_STATUS_TRUE       ZYAN_MAKE_STATUS(0u, ZYAN_MODULE_ZYCORE, 0x02u)
#define ZYAN_STATUS_FALSE       ZYAN_MAKE_STATUS(0u, ZYAN_MODULE_ZYCORE, 0x03u)
#define ZYAN_STATUS_INVALID_ARGUMENT       ZYAN_MAKE_STATUS(1u, ZYAN_MODULE_ZYCORE, 0x04u)
#define ZYAN_STATUS_INVALID_OPERATION       ZYAN_MAKE_STATUS(1u, ZYAN_MODULE_ZYCORE, 0x05u)
#define ZYAN_STATUS_ACCESS_DENIED       ZYAN_MAKE_STATUS(1u, ZYAN_MODULE_ZYCORE, 0x06u)
#define ZYAN_STATUS_NOT_FOUND       ZYAN_MAKE_STATUS(1u, ZYAN_MODULE_ZYCORE, 0x07u)
#define ZYAN_STATUS_OUT_OF_RANGE       ZYAN_MAKE_STATUS(1u, ZYAN_MODULE_ZYCORE, 0x08u)
#define ZYAN_STATUS_INSUFFICIENT_BUFFER_SIZE       ZYAN_MAKE_STATUS(1u, ZYAN_MODULE_ZYCORE, 0x09u)
#define ZYAN_STATUS_NOT_ENOUGH_MEMORY       ZYAN_MAKE_STATUS(1u, ZYAN_MODULE_ZYCORE, 0x0Au)
#define ZYAN_STATUS_BAD_SYSTEMCALL       ZYAN_MAKE_STATUS(1u, ZYAN_MODULE_ZYCORE, 0x0Bu)
#define ZYAN_STATUS_OUT_OF_RESOURCES       ZYAN_MAKE_STATUS(1u, ZYAN_MODULE_ZYCORE, 0x0Cu)
#define ZYAN_STATUS_MISSING_DEPENDENCY       ZYAN_MAKE_STATUS(1u, ZYAN_MODULE_ZYCORE, 0x0Du)
#define ZYAN_STATUS_ARG_NOT_UNDERSTOOD       ZYAN_MAKE_STATUS(1u, ZYAN_MODULE_ARGPARSE, 0x00u)
#define ZYAN_STATUS_TOO_FEW_ARGS       ZYAN_MAKE_STATUS(1u, ZYAN_MODULE_ARGPARSE, 0x01u)
#define ZYAN_STATUS_TOO_MANY_ARGS       ZYAN_MAKE_STATUS(1u, ZYAN_MODULE_ARGPARSE, 0x02u)
#define ZYAN_STATUS_ARG_MISSES_VALUE       ZYAN_MAKE_STATUS(1u, ZYAN_MODULE_ARGPARSE, 0x03u)
#define ZYAN_STATUS_REQUIRED_ARG_MISSING       ZYAN_MAKE_STATUS(1u, ZYAN_MODULE_ARGPARSE, 0x04u)

πŸ¦‹ Typedefs πŸ¦‹

typedef ZyanU32 ZyanStatus

🌈 Detailed Description 🌈

Status code definitions and check macros. Yeah. That's the entire personality of this header and honestly? iconic πŸ‘‘


πŸ’… Macro Definition Documentation πŸ’…

#define ZYAN_CHECK(status)

Value:

do \
{ \
    const ZyanStatus status_047620348 = (status); \
    if (!ZYAN_SUCCESS(status_047620348)) \
    { \
        return status_047620348; \
    } \
} while (0)

Checks if a zyan operation was successful and returns with the status-code, if not. Basically it's the "girl, if this didn't work, we're leaving" macro 😭

Parameters

  • status β€” The zyan status-code to check.

#define ZYAN_FAILED(status)

Value:

((status) & 0x80000000u)

Checks if a zyan operation failed. Vibe check: failed or not πŸ’€

Parameters

  • status β€” The zyan status-code to check.

Returns

ZYAN_TRUE, if the operation failed or ZYAN_FALSE, if not.


#define ZYAN_MAKE_STATUS(error, module, code)

Value:

(ZyanStatus)((((error) & 0x01u) << 31u) | (((module) & 0x7FFu) << 20u) | ((code) & 0xFFFFFu))

Defines a zyan status code. This is the mother macro, the one that constructs every single status you're about to meet 🫢

Parameters

  • error β€” 1, if the status code signals an error or 0, if not.
  • module β€” The module id.
  • code β€” The actual code.

Returns

The zyan status code.


#define ZYAN_MODULE_ARGPARSE 0x003u

The zycore arg-parse submodule id.


#define ZYAN_MODULE_USER 0x3FFu

The base module id for user-defined status codes. Yours, bestie πŸ’–


#define ZYAN_MODULE_ZYCORE 0x001u

The zycore generic module id.


#define ZYAN_STATUS_ACCESS_DENIED ZYAN_MAKE_STATUS(1u, ZYAN_MODULE_ZYCORE, 0x06u)

Insufficient privileges to perform the requested operation. Not your moment, sorry πŸ™ˆ


#define ZYAN_STATUS_ARG_MISSES_VALUE ZYAN_MAKE_STATUS(1u, ZYAN_MODULE_ARGPARSE, 0x03u)

An argument that expected a value misses its value. It said it would bring the value and then showed up empty-handed 😭


#define ZYAN_STATUS_ARG_NOT_UNDERSTOOD ZYAN_MAKE_STATUS(1u, ZYAN_MODULE_ARGPARSE, 0x00u)

Argument was not expected. Who invited you πŸ’€


#define ZYAN_STATUS_BAD_SYSTEMCALL ZYAN_MAKE_STATUS(1u, ZYAN_MODULE_ZYCORE, 0x0Bu)

An unknown error occurred during a system function call. The system is giving mystery, we don't love that βœ‹


#define ZYAN_STATUS_CODE(status)

Value:

((status) & 0xFFFFFu)

Returns the code of a zyan status-code.

Parameters

  • status β€” The zyan status-code.

Returns

The code of the zyan status-code.


#define ZYAN_STATUS_FAILED ZYAN_MAKE_STATUS(1u, ZYAN_MODULE_ZYCORE, 0x01u)

The operation failed with an generic error.


#define ZYAN_STATUS_FALSE ZYAN_MAKE_STATUS(0u, ZYAN_MODULE_ZYCORE, 0x03u)

The operation completed successfully and returned ZYAN_FALSE.


#define ZYAN_STATUS_INSUFFICIENT_BUFFER_SIZE ZYAN_MAKE_STATUS(1u, ZYAN_MODULE_ZYCORE, 0x09u)

A buffer passed to a function was too small to complete the requested operation. The container? Not containing πŸ“


#define ZYAN_STATUS_INVALID_ARGUMENT ZYAN_MAKE_STATUS(1u, ZYAN_MODULE_ZYCORE, 0x04u)

An invalid argument was passed to a function.


#define ZYAN_STATUS_INVALID_OPERATION ZYAN_MAKE_STATUS(1u, ZYAN_MODULE_ZYCORE, 0x05u)

An attempt was made to perform an invalid operation. Bestie no, we don't do that here πŸ™…β€β™€οΈ


#define ZYAN_STATUS_MISSING_DEPENDENCY ZYAN_MAKE_STATUS(1u, ZYAN_MODULE_ZYCORE, 0x0Du)

A dependency library was not found or does have an unexpected version number or feature-set. Your friend didn't show up and also has the wrong version, double betrayal 😀


#define ZYAN_STATUS_MODULE(status)

Value:

(((status) >> 20) & 0x7FFu)

Returns the module id of a zyan status-code.

Parameters

  • status β€” The zyan status-code.

Returns

The module id of the zyan status-code.


#define ZYAN_STATUS_NOT_ENOUGH_MEMORY ZYAN_MAKE_STATUS(1u, ZYAN_MODULE_ZYCORE, 0x0Au)

Insufficient memory to perform the operation. Brain empty, no thoughts 🧚


#define ZYAN_STATUS_NOT_FOUND ZYAN_MAKE_STATUS(1u, ZYAN_MODULE_ZYCORE, 0x07u)

The requested entity was not found. It's not here, it never was, we must move on 🌸


#define ZYAN_STATUS_OUT_OF_RANGE ZYAN_MAKE_STATUS(1u, ZYAN_MODULE_ZYCORE, 0x08u)

An index passed to a function was out of bounds.


#define ZYAN_STATUS_OUT_OF_RESOURCES ZYAN_MAKE_STATUS(1u, ZYAN_MODULE_ZYCORE, 0x0Cu)

The process ran out of resources while performing an operation. Running on fumes and vibes only ✨


#define ZYAN_STATUS_REQUIRED_ARG_MISSING ZYAN_MAKE_STATUS(1u, ZYAN_MODULE_ARGPARSE, 0x04u)

A required argument is missing. Key word required, bestie 😭


#define ZYAN_STATUS_SUCCESS ZYAN_MAKE_STATUS(0u, ZYAN_MODULE_ZYCORE, 0x00u)

The operation completed successfully. We love to see it πŸ’… ✨


#define ZYAN_STATUS_TOO_FEW_ARGS ZYAN_MAKE_STATUS(1u, ZYAN_MODULE_ARGPARSE, 0x01u)

Too few arguments were provided.


#define ZYAN_STATUS_TOO_MANY_ARGS ZYAN_MAKE_STATUS(1u, ZYAN_MODULE_ARGPARSE, 0x02u)

Too many arguments were provided.


#define ZYAN_STATUS_TRUE ZYAN_MAKE_STATUS(0u, ZYAN_MODULE_ZYCORE, 0x02u)

The operation completed successfully and returned ZYAN_TRUE.


#define ZYAN_SUCCESS(status)

Value:

(!((status) & 0x80000000u))

Checks if a zyan operation was successful. Slay check βœ…

Parameters

  • status β€” The zyan status-code to check.

Returns

ZYAN_TRUE, if the operation succeeded or ZYAN_FALSE, if not.


πŸ‘‘ Typedef Documentation πŸ‘‘

typedef ZyanU32 ZyanStatus

Defines the ZyanStatus data type. Main character type energy 🌟


🫢 Author 🫢

Generated automatically by Doxygen for Zycore from the source code.


okay that's the whole page bestie, you're officially fluent in Zycore status codes πŸŽ€ this was Zycore, Version 1.5.2.0, page include/Zycore/Status.h(3) β€” go forth and check your return values, periodt πŸ’œπŸ¦‹

πŸ“¦ where this page comes from