WISP ERT (Client)  1.0.0
The WISP Extended Runtime (WISP side)
rpc.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <ert/runtime.h>
4 #include <ert/urpc.h>
5 
6 //=== ERT RPC marcos ===
8 #define ERT_CONST(name) (ert_consts_store.name)
9 
10 //=== ERT constants ===
12 typedef struct __attribute__((packed)) ert_consts {
13  //Open flags
14  int16_t O_CREAT;
15  int16_t O_RDONLY;
16  int16_t O_WRONLY;
17  int16_t O_RDWR;
18  int16_t O_APPEND;
19 
20  //Whence
21  int16_t SEEK_SET;
22  int16_t SEEK_CUR;
23  int16_t SEEK_END;
24 
25  //Error numbers
26  int16_t EBADF;
27  int16_t EINVAL;
29 
32 
33 //=== ERT functions definition ===
35 static const urpc_func_t ert_func_srv_consts = 0;
37 static const urpc_func_t ert_func_open = 1;
39 static const urpc_func_t ert_func_close = 2;
41 static const urpc_func_t ert_func_read = 3;
43 static const urpc_func_t ert_func_write = 4;
ert_consts_t
Definition: rpc.h:28
#define EINVAL
Invalid argument.
Definition: errno.h:8
static const urpc_func_t ert_func_srv_consts
Get ERT service constants function handle.
Definition: rpc.h:35
#define O_RDWR
Open file for reading and writing.
Definition: fcntl.h:10
#define O_WRONLY
Open file for writing only.
Definition: fcntl.h:8
#define EBADF
Bad file descriptor.
Definition: errno.h:6
static const urpc_func_t ert_func_close
Close remote file function handle.
Definition: rpc.h:39
static const urpc_func_t ert_func_write
Write remote file function handle.
Definition: rpc.h:43
static const urpc_func_t ert_func_read
Read remote file function handle.
Definition: rpc.h:41
#define O_APPEND
Append on each write.
Definition: fcntl.h:12
#define O_CREAT
Create file if it does not exist.
Definition: fcntl.h:14
#define O_RDONLY
Open file for reading only.
Definition: fcntl.h:6
static const urpc_func_t ert_func_open
Open remote file function handle.
Definition: rpc.h:37
ert_consts_t ert_consts_store
ERT filesystem constants store.
Definition: rpc.c:4
struct __attribute__((packed)) ert_consts
ERT filesystem constants structure.
Definition: rpc.h:12