/*
 * SDL2/SDL_net.h for the fredygames.com browser build of Blob Wars (Emscripten): the game only uses SDL_net to
 * reach the author's online medal server, which the browser build never contacts. These stand-ins keep the
 * game's code unchanged and fail every call: SDLNet_Init reports an error, so the game skips the medal service
 * ("Online functions disabled"), and no network code is linked.
 * Copyright (C) 2026 FredyGames. GNU GPL version 2 or later, like Blob Wars.
 */
#ifndef FREDYGAMES_SDL_NET_STUB_H
#define FREDYGAMES_SDL_NET_STUB_H

#include "SDL2/SDL.h"

typedef struct
{
  Uint32 host;
  Uint16 port;
} IPaddress;

typedef struct _TCPsocket *TCPsocket;

static inline int SDLNet_Init (void) { return -1; }
static inline void SDLNet_Quit (void) { }
static inline const char *SDLNet_GetError (void) { return "no network in this build"; }
static inline int SDLNet_ResolveHost (IPaddress *address, const char *host, Uint16 port)
{
  (void) address; (void) host; (void) port;
  return -1;
}
static inline TCPsocket SDLNet_TCP_Open (IPaddress *ip) { (void) ip; return NULL; }
static inline void SDLNet_TCP_Close (TCPsocket sock) { (void) sock; }
static inline int SDLNet_TCP_Send (TCPsocket sock, const void *data, int len)
{
  (void) sock; (void) data; (void) len;
  return -1;
}
static inline int SDLNet_TCP_Recv (TCPsocket sock, void *data, int maxlen)
{
  (void) sock; (void) data; (void) maxlen;
  return -1;
}

#endif
