From 0211ec6326e7de46c996bc3e96c970276567d197 Mon Sep 17 00:00:00 2001 From: crc Date: Wed, 5 Jun 2019 20:19:13 +0000 Subject: [PATCH] rre/unix: begin stubs for sockets support FossilOrigin-Name: 291eea497cdbded9aacc36a71e51c2fbbd511727c931edf5215bdc3a82c3d806 --- source/interfaces/retro-image.c | 2 +- source/interfaces/retro-unix.c | 58 +++++++++++++++++++++++++++++++-- 2 files changed, 56 insertions(+), 4 deletions(-) diff --git a/source/interfaces/retro-image.c b/source/interfaces/retro-image.c index 2ddac18..f011943 100644 --- a/source/interfaces/retro-image.c +++ b/source/interfaces/retro-image.c @@ -466,7 +466,7 @@ int32_t ngaImage[] = { 1793,16271,16411,16453,201912,0,10,1,10,2,10,3,10,4,10,5, 2049,8134,2049,9200,10,1,9252,2049,3111,10,9230,9285,147,97,58,101,110,100,115,45, 119,105,116,104,63,0,1,3,1793,9301,2,2049,7204,1,13,2049,2076,2049,8179,2049, 9200,10,1,9289,2049,3111,10,9269,9312,134,76,80,0,0,9306,9322,134,73,110,100, - 101,120,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 101,120,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, diff --git a/source/interfaces/retro-unix.c b/source/interfaces/retro-unix.c index 39b0e14..04a3206 100644 --- a/source/interfaces/retro-unix.c +++ b/source/interfaces/retro-unix.c @@ -50,7 +50,7 @@ #define D_OFFSET_CLASS 2 #define D_OFFSET_NAME 3 -#define NUM_DEVICES 7 /* Set the number of I/O devices */ +#define NUM_DEVICES 8 /* Set the number of I/O devices */ #define MAX_OPEN_FILES 128 @@ -99,6 +99,9 @@ void io_scripting_query(); void io_image(); void io_image_query(); +void io_socket(); +void query_socket(); + size_t bsd_strlcat(char *dst, const char *src, size_t dsize); size_t bsd_strlcpy(char *dst, const char *src, size_t dsize); @@ -116,7 +119,8 @@ Handler IO_deviceHandlers[NUM_DEVICES + 1] = { io_floatingpoint_handler, io_scripting_handler, io_unix_handler, - io_image + io_image, + io_socket }; Handler IO_queryHandlers[NUM_DEVICES + 1] = { @@ -126,7 +130,8 @@ Handler IO_queryHandlers[NUM_DEVICES + 1] = { io_floatingpoint_query, io_scripting_query, io_unix_query, - io_image_query + io_image_query, + query_socket }; @@ -1285,6 +1290,53 @@ void io_unix_handler() { } +/*=====================================================================*/ + +/*--------------------------------------------------------------------- + BSD Sockets + ---------------------------------------------------------------------*/ + +int Sockets[16]; + +void socket_create() { +} + +void socket_bind() { +} + +void socket_listen() { +} + +void socket_accept() { +} + +void socket_connect() { +} + +void socket_send() { +} + +void socket_sendto() { +} + +void socket_recv() { +} + +void socket_recvfrom() { +} + +void socket_close() { +} + +void io_socket() { + stack_pop(); +} + +void query_socket() { + stack_push(0); + stack_push(7); +} + /*=====================================================================*/