RetroArch
Macros | Functions | Variables
ranetplayer.c File Reference
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
#include "compat/getopt.h"
#include "net/net_socket.h"
#include "../../network/netplay/netplay_private.h"
Include dependency graph for ranetplayer.c:

Macros

#define ERROR()
 
#define EXPAND()
 
#define RECV()
 
#define SEND()
 
#define WRITE()
 

Functions

void usage ()
 
uint32_t frame_offset_cmd (bool ntoh)
 
bool send_input (uint32_t cur_frame)
 
int main (int argc, char **argv)
 

Variables

static int sock
 
static int ranp_in
 
static int ranp_out
 
static uint32_t cmd
 
static uint32_t cmd_size
 
static uint32_tpayload
 
static size_t payload_size
 
static uint32_t frame_offset = 0
 

Macro Definition Documentation

◆ ERROR

#define ERROR ( )
Value:
do { \
fprintf(stderr, "Netplay disconnected.\n"); \
exit(0); \
} while(0)

◆ EXPAND

#define EXPAND ( )
Value:
do { \
while (cmd_size > payload_size) \
{ \
payload_size *= 2; \
payload = realloc(payload, payload_size); \
if (!payload) \
{ \
perror("realloc"); \
exit(1); \
} \
} \
} while (0)
static uint32_t * payload
Definition: ranetplayer.c:87
static uint32_t cmd_size
Definition: ranetplayer.c:87
static size_t payload_size
Definition: ranetplayer.c:88

◆ RECV

#define RECV ( )
Value:
do { \
ERROR(); \
cmd = ntohl(cmd); \
cmd_size = ntohl(cmd_size); \
EXPAND(); \
ERROR(); \
} while(0)
int socket_receive_all_blocking(int fd, void *data_, size_t size)
Definition: net_socket.c:103
static uint32_t * payload
Definition: ranetplayer.c:87
static uint32_t cmd_size
Definition: ranetplayer.c:87
#define ntohl(x)
Definition: inet.h:71
static uint32_t cmd
Definition: ranetplayer.c:87
unsigned int uint32_t
Definition: stdint.h:126
static int sock
Definition: ranetplayer.c:84

◆ SEND

#define SEND ( )
Value:
do { \
uint32_t adj_cmd[2]; \
adj_cmd[0] = htonl(cmd); \
adj_cmd[1] = htonl(cmd_size); \
if (!socket_send_all_blocking(sock, adj_cmd, sizeof(adj_cmd), true) || \
ERROR(); \
} while(0)
#define htonl(x)
Definition: inet.h:70
static uint32_t * payload
Definition: ranetplayer.c:87
int socket_send_all_blocking(int fd, const void *data_, size_t size, bool no_signal)
Definition: net_socket.c:172
static uint32_t cmd_size
Definition: ranetplayer.c:87
static uint32_t cmd
Definition: ranetplayer.c:87
static int sock
Definition: ranetplayer.c:84

◆ WRITE

#define WRITE ( )
Value:
do { \
uint32_t adj_cmd[2]; \
adj_cmd[0] = htonl(cmd); \
adj_cmd[1] = htonl(cmd_size); \
if (write(ranp_out, adj_cmd, sizeof(adj_cmd)) != sizeof(adj_cmd) || \
{ \
perror(ranp_out_file_name); \
close(ranp_out); \
recording_started = recording = false; \
if (!playing) \
socket_close(sock); \
} \
} while(0)
#define htonl(x)
Definition: inet.h:70
static bool write(ElfFile &file, const std::string &filename)
Definition: main.cpp:595
static uint32_t * payload
Definition: ranetplayer.c:87
static uint32_t cmd_size
Definition: ranetplayer.c:87
static uint32_t cmd
Definition: ranetplayer.c:87
static int ranp_out
Definition: ranetplayer.c:84
static int sock
Definition: ranetplayer.c:84

Function Documentation

◆ frame_offset_cmd()

uint32_t frame_offset_cmd ( bool  ntoh)
Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char **  argv 
)

This file contains the main entrypoints for the Wii U executable that set up the call to main().

Here is the call graph for this function:

◆ send_input()

bool send_input ( uint32_t  cur_frame)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ usage()

void usage ( void  )
Here is the caller graph for this function:

Variable Documentation

◆ cmd

uint32_t cmd
static

◆ cmd_size

uint32_t cmd_size
static

◆ frame_offset

uint32_t frame_offset = 0
static

◆ payload

uint32_t * payload
static

◆ payload_size

size_t payload_size
static

◆ ranp_in

int ranp_in
static

◆ ranp_out

int ranp_out
static

◆ sock

int sock
static