SDL_IOStatus(3type)

πŸ’– SDL_IOStatus πŸ’–

okay bestie, welcome to the SDL_IOStatus page β€” it's a datatype situation from SDL3, filed under SDL3 DATATYPES, and honestly? it's giving "tiny enum, huge responsibility" πŸ‘‘


✨ NAME ✨

SDL_IOStatus β€” the SDL_IOStream status, which gets set by a read or write operation. that's it, that's the whole job 🫢


✨ SYNOPSIS ✨

#include <SDL3/SDL_iostream.h>

typedef enum SDL_IOStatus
{
    SDL_IO_STATUS_READY,     /**< Everything is ready (no errors and not EOF). */
    SDL_IO_STATUS_ERROR,     /**< Read or write I/O error */
    SDL_IO_STATUS_EOF,       /**< End of file */
    SDL_IO_STATUS_NOT_READY, /**< Non blocking I/O, not ready */
    SDL_IO_STATUS_READONLY,  /**< Tried to write a read-only buffer */
    SDL_IO_STATUS_WRITEONLY  /**< Tried to read a write-only buffer */
} SDL_IOStatus;

so like, six little statuses, each one telling you exactly what went down on your stream. let's break them down one by one, no skipping, no skimming, we're doing the full tour 🌈

  • SDL_IO_STATUS_READY β€” everything is ready πŸ’… no errors, and not EOF. the good timeline. the main character moment.
  • SDL_IO_STATUS_ERROR β€” a read or write I/O error happened 😭 something went wrong in the plumbing.
  • SDL_IO_STATUS_EOF β€” End of file. you hit the end, bestie, there's nothing left to read 🌸
  • SDL_IO_STATUS_NOT_READY β€” non blocking I/O, and it's just not ready yet πŸ™ˆ not an error, just a "come back later" vibe.
  • SDL_IO_STATUS_READONLY β€” somebody tried to write to a read-only buffer πŸ’€ respectfully: you cannot.
  • SDL_IO_STATUS_WRITEONLY β€” somebody tried to read from a write-only buffer 😭 same energy, opposite direction.

✨ AVAILABILITY ✨

this enum has been around since SDL 3.2.0 πŸŽ€ so if you're on anything newer, you're golden. slay.


Simple Directmedia Layer made this, we're kicking it at version SDL 3.4.18, and yes this whole page is literally called SDL_IOStatus(3type) β€” thanks for coming to my TED talk, ily, go check your stream status πŸ¦‹βœ¨πŸ’œ

πŸ“¦ where this page comes from