@@ -45,6 +45,24 @@ const char *srv_pwd;
45
45
unsigned char * srv_header ;
46
46
size_t srv_header_len ;
47
47
48
+ #ifndef DISABLE_RUST
49
+ extern void ccxr_connect_to_srv (const char * addr , const char * port , const char * cc_desc , const char * pwd );
50
+ extern void ccxr_net_send_header (const unsigned char * data , size_t len );
51
+ extern int ccxr_net_send_cc (const unsigned char * data , int length , void * private_data , struct cc_subtitle * sub );
52
+ extern void ccxr_net_check_conn ();
53
+ extern void ccxr_net_send_epg (
54
+ const char * start ,
55
+ const char * stop ,
56
+ const char * title ,
57
+ const char * desc ,
58
+ const char * lang ,
59
+ const char * category );
60
+ extern int ccxr_net_tcp_read (int socket , void * buffer , size_t length );
61
+ extern int ccxr_net_udp_read (int socket , void * buffer , size_t length , const char * src_str , const char * addr_str );
62
+ extern int ccxr_start_tcp_srv (const char * port , const char * pwd );
63
+ extern int ccxr_start_udp_srv (const char * src , const char * addr , unsigned port );
64
+ #endif
65
+
48
66
/*
49
67
* Established connection to specified address.
50
68
* Returns socked id
@@ -84,6 +102,9 @@ int set_nonblocking(int fd);
84
102
85
103
void connect_to_srv (const char * addr , const char * port , const char * cc_desc , const char * pwd )
86
104
{
105
+ #ifndef DISABLE_RUST
106
+ return ccxr_connect_to_srv (addr , port , cc_desc , pwd );
107
+ #endif
87
108
if (NULL == addr )
88
109
{
89
110
mprint ("Server address is not set\n" );
@@ -115,6 +136,9 @@ void connect_to_srv(const char *addr, const char *port, const char *cc_desc, con
115
136
116
137
void net_send_header (const unsigned char * data , size_t len )
117
138
{
139
+ #ifndef DISABLE_RUST
140
+ return ccxr_net_send_header (data , len );
141
+ #endif
118
142
assert (srv_sd > 0 );
119
143
120
144
#if DEBUG_OUT
@@ -141,6 +165,9 @@ void net_send_header(const unsigned char *data, size_t len)
141
165
142
166
int net_send_cc (const unsigned char * data , int len , void * private_data , struct cc_subtitle * sub )
143
167
{
168
+ #ifndef DISABLE_RUST
169
+ return ccxr_net_send_cc (data , len , private_data , sub );
170
+ #endif
144
171
assert (srv_sd > 0 );
145
172
146
173
#if DEBUG_OUT
@@ -160,6 +187,9 @@ int net_send_cc(const unsigned char *data, int len, void *private_data, struct c
160
187
161
188
void net_check_conn ()
162
189
{
190
+ #ifndef DISABLE_RUST
191
+ return ccxr_net_check_conn ();
192
+ #endif
163
193
time_t now ;
164
194
static time_t last_ping = 0 ;
165
195
char c = 0 ;
@@ -221,6 +251,9 @@ void net_send_epg(
221
251
const char * lang ,
222
252
const char * category )
223
253
{
254
+ #ifndef DISABLE_RUST
255
+ return ccxr_net_send_epg (start , stop , title , desc , lang , category );
256
+ #endif
224
257
size_t st ;
225
258
size_t sp ;
226
259
size_t t ;
@@ -301,6 +334,9 @@ void net_send_epg(
301
334
302
335
int net_tcp_read (int socket , void * buffer , size_t length )
303
336
{
337
+ #ifndef DISABLE_RUST
338
+ return ccxr_net_tcp_read (socket , buffer , length );
339
+ #endif
304
340
assert (buffer != NULL );
305
341
assert (length > 0 );
306
342
@@ -333,6 +369,9 @@ int net_tcp_read(int socket, void *buffer, size_t length)
333
369
334
370
int net_udp_read (int socket , void * buffer , size_t length , const char * src_str , const char * addr_str )
335
371
{
372
+ #ifndef DISABLE_RUST
373
+ return ccxr_net_udp_read (socket , buffer , length , src_str , addr_str );
374
+ #endif
336
375
assert (buffer != NULL );
337
376
assert (length > 0 );
338
377
@@ -519,6 +558,9 @@ int tcp_connect(const char *host, const char *port)
519
558
520
559
int start_tcp_srv (const char * port , const char * pwd )
521
560
{
561
+ #ifndef DISABLE_RUST
562
+ return ccxr_start_tcp_srv (port , pwd );
563
+ #endif
522
564
if (NULL == port )
523
565
port = DFT_PORT ;
524
566
@@ -974,6 +1016,10 @@ ssize_t read_byte(int fd, char *ch)
974
1016
975
1017
int start_upd_srv (const char * src_str , const char * addr_str , unsigned port )
976
1018
{
1019
+ #ifndef DISABLE_RUST
1020
+ return ccxr_start_udp_srv (src_str , addr_str , port );
1021
+ #endif
1022
+
977
1023
init_sockets ();
978
1024
979
1025
in_addr_t src ;
0 commit comments