summaryrefslogtreecommitdiffstats
path: root/src/rccexternal.h
blob: 181a6ec9e617e7aaf61886bf05443d1438616529 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef _RCC_EXTERNAL_H
#define _RCC_EXTERNAL_H

#include "../config.h"

typedef enum rcc_external_module_t {
    RCC_EXTERNAL_MODULE_CONTROL = 0,
    RCC_EXTERNAL_MODULE_OPTIONS,
    RCC_EXTERNAL_MODULE_LIBRTRANSLATE,
    RCC_EXTERNAL_MODULE_MAX
} rcc_external_module;

struct rcc_external_info_t {
    int s;
};
typedef struct rcc_external_info_t rcc_external_info_s;
typedef struct rcc_external_info_t *rcc_external_info;

typedef enum rcc_external_option_t {
    RCC_EXTERNAL_OPTION_OFFLINE = 0,
    RCC_EXTERNAL_OPTION_MAX
} rcc_external_option;

struct rcc_external_command_t {
    unsigned long size;
    unsigned char cmd;
};
typedef struct rcc_external_command_t rcc_external_command_s;
typedef struct rcc_external_command_t *rcc_external_command;

#define RCC_EXTERNAL_COMMAND_CLOSE 0

int rccExternalInit();
void rccExternalFree();

int rccExternalAllowOfflineMode();

size_t rccExternalWrite(int s, const char *buffer, ssize_t size, unsigned long timeout);
size_t rccExternalRead(int s, char *buffer, ssize_t size, unsigned long timeout);
int rccExternalConnect(unsigned char module);
void rccExternalClose(int s);

#endif /* _RCC_EXTERNAL_H */