LMMS
Loading...
Searching...
No Matches
eel_net.h
Go to the documentation of this file.
1#ifndef _EEL_NET_H_
2#define _EEL_NET_H_
3
4// x = tcp_listen(port[,interface, connected_ip_out]) poll this, returns connection id > 0, or <0 on error, or 0 if no new connect -- interface only valid on first call (or after tcp_listen_end(port))
5// tcp_listen_end(port);
6
7// connection = tcp_connect(host, port[, block]) // connection id > 0 on ok
8// tcp_set_block(connection, block?)
9// tcp_close(connection)
10
11// tcp_send(connection, string[, length]) // can return 0 if block, -1 if error, otherwise returns length sent
12// tcp_recv(connection, string[, maxlength]) // 0 on nothing, -1 on error, otherwise returns length recv'd
13
14
15// need:
16// #define EEL_NET_GET_CONTEXT(opaque) (((sInst *)opaque)->m_net_state)
17
18// you must pass a JNL_AsyncDNS object to eel_net_state to support nonblocking connect with DNS resolution, otherwise DNS will block
19// #define EEL_NET_NO_SYNC_DNS -- never ever call gethostbyname() synchronously, may disable DNS for blocking connect, or if a JNL_IAsyncDNS is not provided.
20
21#ifndef EEL_NET_MAXSEND
22#define EEL_NET_MAXSEND (EEL_STRING_MAXUSERSTRING_LENGTH_HINT+4096)
23#endif
24
25
26#include "../jnetlib/netinc.h"
27#define JNL_NO_IMPLEMENTATION
28#include "../jnetlib/asyncdns.h"
29
31{
32 public:
34 enum { CONNECTION_ID_BASE=0x110000 };
35
36 eel_net_state(int max_con, JNL_IAsyncDNS *dns);
38
40 char *hostname; // set during resolve only
41 SOCKET sock;
42 int state; // STATE_RESOLVING...
43 int port;
45 };
48 JNL_IAsyncDNS *m_dns;
49
50 EEL_F onConnect(char *hostNameOwned, int port, int block);
51 EEL_F onClose(void *opaque, EEL_F handle);
52 EEL_F set_block(void *opaque, EEL_F handle, bool block);
53 EEL_F onListen(void *opaque, EEL_F handle, int mode, EEL_F *ifStr, EEL_F *ipOut);
54
55 int __run_connect(connection_state *cs, unsigned int ip);
56 int __run(connection_state *cs);
57 int do_send(void *opaque, EEL_F h, const char *src, int len);
58 int do_recv(void *opaque, EEL_F h, char *buf, int maxlen);
59 #ifdef _WIN32
60 bool m_had_socketlib_init;
61 #endif
62};
63
64eel_net_state::eel_net_state(int max_con, JNL_IAsyncDNS *dns)
65{
66 #ifdef _WIN32
67 m_had_socketlib_init=false;
68 #endif
69
70 m_cons.Resize(max_con);
71 int x;
72 for (x=0;x<m_cons.GetSize();x++)
73 {
74 m_cons.Get()[x].state = STATE_FREE;
75 m_cons.Get()[x].sock = INVALID_SOCKET;
76 m_cons.Get()[x].hostname = NULL;
77 }
78 m_dns=dns;
79}
80
82{
83 int x;
84 for (x=0;x<m_cons.GetSize();x++)
85 {
86 SOCKET s=m_cons.Get()[x].sock;
87 if (s != INVALID_SOCKET)
88 {
89 shutdown(s,SHUT_RDWR);
90 closesocket(s);
91 }
92 free(m_cons.Get()[x].hostname);
93 }
94 for (x=0;x<m_listens.GetSize();x++)
95 {
96 SOCKET s=m_listens.Enumerate(x);
97 shutdown(s, SHUT_RDWR);
98 closesocket(s);
99 }
100}
101EEL_F eel_net_state::onConnect(char *hostNameOwned, int port, int block)
102{
103 int x;
104#ifdef _WIN32
105 if (!m_had_socketlib_init)
106 {
107 m_had_socketlib_init=1;
108 WSADATA wsaData;
109 WSAStartup(MAKEWORD(1, 1), &wsaData);
110 }
111#endif
112 for(x=0;x<m_cons.GetSize();x++)
113 {
114 connection_state *s=m_cons.Get()+x;
115 if (s->state == STATE_FREE)
116 {
117 unsigned int ip=inet_addr(hostNameOwned);
118 if (m_dns && ip == INADDR_NONE && !block)
119 {
120 const int r=m_dns->resolve(hostNameOwned,&ip);
121 if (r<0) break; // error!
122
123 if (r>0) ip = INADDR_NONE;
124 }
125#ifndef EEL_NET_NO_SYNC_DNS
126 else if (ip == INADDR_NONE)
127 {
128 struct hostent *he = gethostbyname(hostNameOwned);
129 if (he) ip = *(int *)he->h_addr;
130 }
131#endif
132 if (hostNameOwned || ip != INADDR_NONE)
133 {
134 if (ip != INADDR_NONE)
135 {
136 free(hostNameOwned);
137 hostNameOwned=NULL;
138 }
139
140 s->state = STATE_RESOLVING;
141 s->hostname = hostNameOwned;
142 s->blockmode = !!block;
143 s->port = port;
144 if (hostNameOwned || __run_connect(s,ip)) return x + CONNECTION_ID_BASE;
145
146 s->state=STATE_FREE;
147 s->hostname=NULL;
148 }
149 break;
150 }
151 }
152 free(hostNameOwned);
153 return -1;
154}
155
156EEL_F eel_net_state::onListen(void *opaque, EEL_F handle, int mode, EEL_F *ifStr, EEL_F *ipOut)
157{
158 const int port = (int) handle;
159 if (port < 1 || port > 65535)
160 {
161#ifdef EEL_STRING_DEBUGOUT
162 EEL_STRING_DEBUGOUT("tcp_listen(%d): invalid port specified, will never succeed",port);
163#endif
164 return 0.0;
165 }
166#ifdef _WIN32
167 if (!m_had_socketlib_init)
168 {
169 m_had_socketlib_init=1;
170 WSADATA wsaData;
171 WSAStartup(MAKEWORD(1, 1), &wsaData);
172 }
173#endif
174 SOCKET *sockptr = m_listens.GetPtr(port);
175 if (mode<0)
176 {
177 if (!sockptr) return -1.0;
178
179 SOCKET ss=*sockptr;
180 m_listens.Delete(port);
181 if (ss != INVALID_SOCKET)
182 {
183 shutdown(ss, SHUT_RDWR);
184 closesocket(ss);
185 }
186 return 0.0;
187 }
188 if (!sockptr)
189 {
190 struct sockaddr_in sin;
191 memset((char *) &sin, 0,sizeof(sin));
192 if (ifStr)
193 {
195 const char *fn = EEL_STRING_GET_FOR_INDEX(*ifStr,NULL);
196#ifdef EEL_STRING_DEBUGOUT
197 if (!fn) EEL_STRING_DEBUGOUT("tcp_listen(%d): bad string identifier %f for second parameter (interface)",port,*ifStr);
198#endif
199 if (fn && *fn) sin.sin_addr.s_addr=inet_addr(fn);
200
201 }
202 if (!sin.sin_addr.s_addr || sin.sin_addr.s_addr==INADDR_NONE) sin.sin_addr.s_addr = INADDR_ANY;
203 sin.sin_family = AF_INET;
204 sin.sin_port = htons( (short) port );
205 SOCKET sock = socket(AF_INET,SOCK_STREAM,0);
206 if (sock != INVALID_SOCKET)
207 {
208 SET_SOCK_DEFAULTS(sock);
209 SET_SOCK_BLOCK(sock,0);
210 if (bind(sock,(struct sockaddr *)&sin,sizeof(sin)) || listen(sock,8)==-1)
211 {
212 shutdown(sock, SHUT_RDWR);
213 closesocket(sock);
214 sock=INVALID_SOCKET;
215 }
216 }
217#ifdef EEL_STRING_DEBUGOUT
218 //if (sock == INVALID_SOCKET) EEL_STRING_DEBUGOUT("tcp_listen(%d): failed listening on port",port);
219 // we report -1 to the caller, no need to error message
220#endif
221 m_listens.Insert(port,sock);
222 sockptr = m_listens.GetPtr(port);
223 }
224 if (!sockptr || *sockptr == INVALID_SOCKET) return -1;
225
226 struct sockaddr_in saddr;
227 socklen_t length = sizeof(struct sockaddr_in);
228 SOCKET newsock = accept(*sockptr, (struct sockaddr *) &saddr, &length);
229 if (newsock == INVALID_SOCKET)
230 {
231 return 0; // nothing to report here
232 }
233 SET_SOCK_DEFAULTS(newsock);
234
235 int x;
236 for(x=0;x<m_cons.GetSize();x++)
237 {
238 connection_state *cs=m_cons.Get()+x;
239 if (cs->state == STATE_FREE)
240 {
242 free(cs->hostname);
243 cs->hostname=NULL;
244 cs->sock = newsock;
245 cs->blockmode=true;
246 cs->port=0;
247 if (ipOut)
248 {
250 WDL_FastString *ws=NULL;
251 EEL_STRING_GET_FOR_WRITE(*ipOut,&ws);
252 if (ws)
253 {
254 const unsigned int a = ntohl(saddr.sin_addr.s_addr);
255 ws->SetFormatted(128,"%d.%d.%d.%d",(a>>24)&0xff,(a>>16)&0xff,(a>>8)&0xff,a&0xff);
256 }
257 else
258 {
259#ifdef EEL_STRING_DEBUGOUT
260 EEL_STRING_DEBUGOUT("tcp_listen(%d): bad string identifier %f for third parameter (IP-out)",port,*ipOut);
261#endif
262 }
263 }
264 return x + CONNECTION_ID_BASE;
265 }
266 }
267 shutdown(newsock, SHUT_RDWR);
268 closesocket(newsock);
269 return -1;
270
271
272}
273
275{
276 SOCKET s=socket(AF_INET,SOCK_STREAM,0);
277 if (s == INVALID_SOCKET) return 0;
278 SET_SOCK_DEFAULTS(s);
279
280 if (!cs->blockmode) SET_SOCK_BLOCK(s,0);
281
282 struct sockaddr_in sa={0,};
283 sa.sin_family=AF_INET;
284 sa.sin_addr.s_addr = ip;
285 sa.sin_port = htons(cs->port);
286 if (!connect(s,(struct sockaddr *)&sa,16) || (!cs->blockmode && JNL_ERRNO == JNL_EINPROGRESS))
287 {
289 cs->sock = s;
290 return 1;
291 }
292 shutdown(s, SHUT_RDWR);
293 closesocket(s);
294 return 0;
295}
296
298{
299 if (cs->sock != INVALID_SOCKET) return 0;
300
301 if (!cs->hostname) return -1;
302
303 unsigned int ip=INADDR_NONE;
304 const int r=m_dns ? m_dns->resolve(cs->hostname,&ip) : -1;
305 if (r>0) return 0;
306
307 free(cs->hostname);
308 cs->hostname=NULL;
309
310 if (r<0 || !__run_connect(cs,ip))
311 {
312 cs->state = STATE_ERR;
313 return -1;
314 }
315
316 return 0;
317}
318
319int eel_net_state::do_recv(void *opaque, EEL_F h, char *buf, int maxlen)
320{
321 const int idx=(int)h-CONNECTION_ID_BASE;
322 if (idx>=0 && idx<m_cons.GetSize())
323 {
324 connection_state *s=m_cons.Get()+idx;
325#ifdef EEL_STRING_DEBUGOUT
326 if (s->sock == INVALID_SOCKET && !s->hostname)
327 EEL_STRING_DEBUGOUT("tcp_recv: connection identifier %f is not open",h);
328#endif
329 if (__run(s) || s->sock == INVALID_SOCKET) return s->state == STATE_ERR ? -1 : 0;
330
331 if (maxlen == 0) return 0;
332
333 const int rv=(int)recv(s->sock,buf,maxlen,0);
334 if (rv < 0 && !s->blockmode && (JNL_ERRNO == JNL_EWOULDBLOCK || JNL_ERRNO == JNL_ENOTCONN)) return 0;
335
336 if (!rv) return -1; // TCP, 0=connection terminated
337
338 return rv;
339 }
340#ifdef EEL_STRING_DEBUGOUT
341 EEL_STRING_DEBUGOUT("tcp_recv: connection identifier %f is out of range",h);
342#endif
343 return -1;
344}
345
346int eel_net_state::do_send(void *opaque, EEL_F h, const char *src, int len)
347{
348 const int idx=(int)h-CONNECTION_ID_BASE;
349 if (idx>=0 && idx<m_cons.GetSize())
350 {
351 connection_state *s=m_cons.Get()+idx;
352#ifdef EEL_STRING_DEBUGOUT
353 if (s->sock == INVALID_SOCKET && !s->hostname)
354 EEL_STRING_DEBUGOUT("tcp_send: connection identifier %f is not open",h);
355#endif
356 if (__run(s) || s->sock == INVALID_SOCKET) return s->state == STATE_ERR ? -1 : 0;
357 const int rv=(int)send(s->sock,src,len,0);
358 if (rv < 0 && !s->blockmode && (JNL_ERRNO == JNL_EWOULDBLOCK || JNL_ERRNO == JNL_ENOTCONN)) return 0;
359 return rv;
360 }
361 else
362 {
363#ifdef EEL_STRING_DEBUGOUT
364 EEL_STRING_DEBUGOUT("tcp_send: connection identifier %f out of range",h);
365#endif
366 }
367 return -1;
368}
369
370EEL_F eel_net_state::set_block(void *opaque, EEL_F handle, bool block)
371{
372 int idx=(int)handle-CONNECTION_ID_BASE;
373 if (idx>=0 && idx<m_cons.GetSize())
374 {
375 connection_state *s=m_cons.Get()+idx;
376 if (s->blockmode != block)
377 {
378 s->blockmode=block;
379 if (s->sock != INVALID_SOCKET)
380 {
381 SET_SOCK_BLOCK(s->sock,(block?1:0));
382 }
383 else
384 {
385#ifdef EEL_STRING_DEBUGOUT
386 if (!s->hostname) EEL_STRING_DEBUGOUT("tcp_set_block: connection identifier %f is not open",handle);
387#endif
388 }
389 return 1;
390 }
391 }
392 else
393 {
394#ifdef EEL_STRING_DEBUGOUT
395 EEL_STRING_DEBUGOUT("tcp_set_block: connection identifier %f out of range",handle);
396#endif
397 }
398 return 0;
399}
400
401EEL_F eel_net_state::onClose(void *opaque, EEL_F handle)
402{
403 int idx=(int)handle-CONNECTION_ID_BASE;
404 if (idx>=0 && idx<m_cons.GetSize())
405 {
406 connection_state *s=m_cons.Get()+idx;
407 const bool hadhn = !!s->hostname;
408 free(s->hostname);
409 s->hostname = NULL;
410 s->state = STATE_ERR;
411 if (s->sock != INVALID_SOCKET)
412 {
413 shutdown(s->sock,SHUT_RDWR);
414 closesocket(s->sock);
415 s->sock = INVALID_SOCKET;
416 return 1.0;
417 }
418 else if (!hadhn)
419 {
420#ifdef EEL_STRING_DEBUGOUT
421 EEL_STRING_DEBUGOUT("tcp_close: connection identifier %f is not open",handle);
422#endif
423 }
424 }
425 else
426 {
427#ifdef EEL_STRING_DEBUGOUT
428 EEL_STRING_DEBUGOUT("tcp_close: connection identifier %f is out of range",handle);
429#endif
430 }
431 return 0.0;
432}
433
434
435static EEL_F NSEEL_CGEN_CALL _eel_tcp_connect(void *opaque, INT_PTR np, EEL_F **parms)
436{
437 eel_net_state *ctx;
438 if (np > 1 && NULL != (ctx=EEL_NET_GET_CONTEXT(opaque)))
439 {
440 char *dest=NULL;
441 {
443 const char *fn = EEL_STRING_GET_FOR_INDEX(parms[0][0],NULL);
444 if (fn) dest=strdup(fn);
445 else
446 {
447#ifdef EEL_STRING_DEBUGOUT
448 EEL_STRING_DEBUGOUT("tcp_connect(): host string identifier %f invalid",parms[0][0]);
449#endif
450 }
451 }
452 if (dest) return ctx->onConnect(dest, (int) (parms[1][0]+0.5), np < 3 || parms[2][0] >= 0.5);
453 }
454 return -1.0;
455}
456
457static EEL_F NSEEL_CGEN_CALL _eel_tcp_set_block(void *opaque, EEL_F *handle, EEL_F *bl)
458{
459 eel_net_state *ctx;
460 if (NULL != (ctx=EEL_NET_GET_CONTEXT(opaque))) return ctx->set_block(opaque,*handle, *bl >= 0.5);
461 return 0;
462}
463
464static EEL_F NSEEL_CGEN_CALL _eel_tcp_close(void *opaque, EEL_F *handle)
465{
466 eel_net_state *ctx;
467 if (NULL != (ctx=EEL_NET_GET_CONTEXT(opaque))) return ctx->onClose(opaque,*handle);
468 return 0;
469}
470
471static EEL_F NSEEL_CGEN_CALL _eel_tcp_recv(void *opaque, INT_PTR np, EEL_F **parms)
472{
473 eel_net_state *ctx;
474 if (np > 1 && NULL != (ctx=EEL_NET_GET_CONTEXT(opaque)))
475 {
477 int ml = np > 2 ? (int)parms[2][0] : 4096;
479
480 ml=ctx->do_recv(opaque,parms[0][0],buf,ml);
481
482 {
484 WDL_FastString *ws=NULL;
485 EEL_STRING_GET_FOR_WRITE(parms[1][0],&ws);
486 if (ws)
487 {
488 if (ml<=0) ws->Set("");
489 else ws->SetRaw(buf,ml);
490 }
491 }
492 return ml;
493 }
494 return -1;
495}
496
497static EEL_F NSEEL_CGEN_CALL _eel_tcp_send(void *opaque, INT_PTR np, EEL_F **parms)
498{
499 eel_net_state *ctx;
500 if (np > 1 && NULL != (ctx=EEL_NET_GET_CONTEXT(opaque)))
501 {
502 char buf[EEL_NET_MAXSEND];
503
504 int l;
505 {
507 WDL_FastString *ws=NULL;
508 const char *fn = EEL_STRING_GET_FOR_INDEX(parms[1][0],&ws);
509 l = ws ? ws->GetLength() : (int) strlen(fn);
510 if (np > 2)
511 {
512 int al=(int)parms[2][0];
513 if (al<0) al=0;
514 if (al<l) l=al;
515 }
516 if (l > 0) memcpy(buf,fn,l);
517 }
518 if (l>0) return ctx->do_send(opaque,parms[0][0],buf,l);
519 return 0;
520 }
521 return -1;
522}
523
524static EEL_F NSEEL_CGEN_CALL _eel_tcp_listen(void *opaque, INT_PTR np, EEL_F **parms)
525{
526 eel_net_state *ctx;
527 if (NULL != (ctx=EEL_NET_GET_CONTEXT(opaque))) return ctx->onListen(opaque,parms[0][0],1,np>1?parms[1]:NULL,np>2?parms[2]:NULL);
528 return 0;
529}
530
531static EEL_F NSEEL_CGEN_CALL _eel_tcp_listen_end(void *opaque, EEL_F *handle)
532{
533 eel_net_state *ctx;
534 if (NULL != (ctx=EEL_NET_GET_CONTEXT(opaque))) return ctx->onListen(opaque,*handle,-1,NULL,NULL);
535 return 0;
536}
537
538
551
552#ifdef EEL_WANT_DOCUMENTATION
553const char *eel_net_function_reference =
554 "tcp_listen\tport[,\"interface\",#ip_out]\tListens on port specified. Returns less than 0 if could not listen, 0 if no new connection available, or greater than 0 (as a TCP connection ID) if a new connection was made. If a connection made and #ip_out specified, it will be set to the remote IP. interface can be empty for all interfaces, otherwise an interface IP as a string.\0"
555 "tcp_listen_end\tport\tEnds listening on port specified.\0"
556 "tcp_connect\t\"address\",port[,block]\tCreate a new TCP connection to address:port. If block is specified and 0, connection will be made nonblocking. Returns TCP connection ID greater than 0 on success.\0"
557 "tcp_send\tconnection,\"str\"[,len]\tSends a string to connection. Returns -1 on error, 0 if connection is non-blocking and would block, otherwise returns length sent. If len is specified and not less than 1, only the first len bytes of the string parameter will be sent.\0"
558 "tcp_recv\tconnection,#str[,maxlen]\tReceives data from a connection to #str. If maxlen is specified, no more than maxlen bytes will be received. If non-blocking, 0 will be returned if would block. Returns less than 0 if error.\0"
559 "tcp_set_block\tconnection,block\tSets whether a connection blocks.\0"
560 "tcp_close\tconnection\tCloses a TCP connection created by tcp_listen() or tcp_connect().\0"
561;
562#endif
563
564#endif
#define bind(x, y)
#define NULL
Definition CarlaBridgeFormat.cpp:30
uint8_t a
Definition Spc_Cpu.h:141
static void shutdown(void)
Definition adplugdb.cpp:297
Definition assocarray.h:352
Definition heapbuf.h:259
Definition eel_net.h:31
int do_recv(void *opaque, EEL_F h, char *buf, int maxlen)
Definition eel_net.h:319
@ CONNECTION_ID_BASE
Definition eel_net.h:34
int __run(connection_state *cs)
Definition eel_net.h:297
EEL_F onListen(void *opaque, EEL_F handle, int mode, EEL_F *ifStr, EEL_F *ipOut)
Definition eel_net.h:156
~eel_net_state()
Definition eel_net.h:81
eel_net_state(int max_con, JNL_IAsyncDNS *dns)
Definition eel_net.h:64
EEL_F onClose(void *opaque, EEL_F handle)
Definition eel_net.h:401
EEL_F onConnect(char *hostNameOwned, int port, int block)
Definition eel_net.h:101
int __run_connect(connection_state *cs, unsigned int ip)
Definition eel_net.h:274
int do_send(void *opaque, EEL_F h, const char *src, int len)
Definition eel_net.h:346
@ STATE_CONNECTED
Definition eel_net.h:33
@ STATE_ERR
Definition eel_net.h:33
@ STATE_FREE
Definition eel_net.h:33
@ STATE_RESOLVING
Definition eel_net.h:33
JNL_IAsyncDNS * m_dns
Definition eel_net.h:48
WDL_TypedBuf< connection_state > m_cons
Definition eel_net.h:46
EEL_F set_block(void *opaque, EEL_F handle, bool block)
Definition eel_net.h:370
WDL_IntKeyedArray< SOCKET > m_listens
Definition eel_net.h:47
int * l
Definition inflate.c:1579
unsigned ml
Definition inflate.c:944
unsigned bl
Definition inflate.c:935
unsigned s
Definition inflate.c:1555
unsigned x[BMAX+1]
Definition inflate.c:1586
#define NSEEL_addfunc_varparm(name, min_np, pproc, fptr)
Definition eel_import.h:63
#define NSEEL_addfunc_retval(name, np, pproc, fptr)
Definition eel_import.h:51
void *(* NSEEL_PProc_THIS)(void *data, int data_size, struct _compileContext *ctx)
Definition eel_import.h:40
static EEL_F NSEEL_CGEN_CALL _eel_tcp_send(void *opaque, INT_PTR np, EEL_F **parms)
Definition eel_net.h:497
void EEL_tcp_register()
Definition eel_net.h:539
static EEL_F NSEEL_CGEN_CALL _eel_tcp_close(void *opaque, EEL_F *handle)
Definition eel_net.h:464
static EEL_F NSEEL_CGEN_CALL _eel_tcp_connect(void *opaque, INT_PTR np, EEL_F **parms)
Definition eel_net.h:435
#define EEL_NET_MAXSEND
Definition eel_net.h:22
static EEL_F NSEEL_CGEN_CALL _eel_tcp_listen_end(void *opaque, EEL_F *handle)
Definition eel_net.h:531
static EEL_F NSEEL_CGEN_CALL _eel_tcp_recv(void *opaque, INT_PTR np, EEL_F **parms)
Definition eel_net.h:471
static EEL_F NSEEL_CGEN_CALL _eel_tcp_set_block(void *opaque, EEL_F *handle, EEL_F *bl)
Definition eel_net.h:457
static EEL_F NSEEL_CGEN_CALL _eel_tcp_listen(void *opaque, INT_PTR np, EEL_F **parms)
Definition eel_net.h:524
#define EEL_STRING_GET_FOR_WRITE(x, wr)
Definition eel_strings.h:100
#define EEL_STRING_GET_FOR_INDEX(x, wr)
Definition eel_strings.h:96
#define EEL_STRING_MUTEXLOCK_SCOPE
Definition eel_strings.h:90
#define opaque
Definition eelscript.h:281
#define EEL_NET_GET_CONTEXT(opaque)
Definition eelscript.h:196
#define NSEEL_CGEN_CALL
Definition ns-eel.h:44
png_uint_32 length
Definition png.c:2247
png_structrp int mode
Definition png.h:1139
Definition eel_net.h:39
char * hostname
Definition eel_net.h:40
bool blockmode
Definition eel_net.h:44
int state
Definition eel_net.h:42
SOCKET sock
Definition eel_net.h:41
int port
Definition eel_net.h:43
const char const char const char const char char * fn
Definition swell-functions.h:168
intptr_t INT_PTR
Definition swell-types.h:42
#define MAKEWORD(a, b)
Definition swell-types.h:85
memcpy(hh, h, RAND_HEAD_LEN)
int r
Definition crypt.c:458
uch h[RAND_HEAD_LEN]
Definition crypt.c:459
typedef int(UZ_EXP MsgFn)()
ss
Definition zipinfo.c:2292
#define EEL_STRING_MAXUSERSTRING_LENGTH_HINT
Definition ysfx_api_eel.cpp:35