ICP  1
isisds_command.h
Go to the documentation of this file.
1 #ifndef ISISDS_COMMAND_H
2 #define ISISDS_COMMAND_H
3 
4 typedef void (*isisds_error_report_t)(int status, int code, const char* messsage);
5 
6 #define ISISDS_PORT 6789
7 
8 #ifdef _WIN32
9 #include <winsock2.h>
10 #else
11 #define SOCKET int
12 #define INVALID_SOCKET -1
13 #endif /* _WIN32 */
14 
16 
18 static int isisds_type_size[] = { 0, 4, 4, 8, 1 };
19 static const char* isisds_type_name[] = { "Unknown", "Int32", "Real32", "Real64", "Char" };
20 static const char* isisds_type_code[] = { "U00", "I32", "R32", "R64", "C08" }; /* 3 char in length */
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif /* __cplusplus */
25 
26 SOCKET isisds_send_open(const char* host, ISISDSAccessMode access_type);
27 int isisds_recv_open(SOCKET s, ISISDSAccessMode* access_type);
28 int isisds_send_command(SOCKET s, const char* command, const void* data, ISISDSDataType type, const int dims_array[], int ndims);
29 int isisds_recv_command_alloc(SOCKET s, char** command, void** data, ISISDSDataType* type, int dims_array[], int* ndims);
30 int isisds_recv_command(SOCKET s, char* command, int* len_command, void* data, ISISDSDataType* type, int dims_array[], int* ndims);
32 
34 int isisds_report(int status, int code, const char* format, ... );
35 
36 #ifdef __cplusplus
37 }
38 #endif /* __cplusplus */
39 
40 #endif /* ISISDS_COMMAND_H */
ISISDSDataType
int isisds_report(int status, int code, const char *format,...)
int isisds_send_command(SOCKET s, const char *command, const void *data, ISISDSDataType type, const int dims_array[], int ndims)
int isisds_recv_command(SOCKET s, char *command, int *len_command, void *data, ISISDSDataType *type, int dims_array[], int *ndims)
void(* isisds_error_report_t)(int status, int code, const char *messsage)
Definition: isisds_command.h:4
static const char * isisds_type_code[]
int isisds_send_close(SOCKET s)
#define SOCKET
int isisds_set_report_func(isisds_error_report_t report_func)
static const char * isisds_type_name[]
ISISDSAccessMode
static int isisds_type_size[]
int isisds_recv_open(SOCKET s, ISISDSAccessMode *access_type)
SOCKET isisds_send_open(const char *host, ISISDSAccessMode access_type)
int isisds_recv_command_alloc(SOCKET s, char **command, void **data, ISISDSDataType *type, int dims_array[], int *ndims)