#endif
#include "SimpleHash.h"
#include "GenericHashtable.h"
+#include "methodheaders.h"
struct RuntimeHash *fdtoobject;
+#ifdef D___Socket______nativeConnect____I__AR_B_I
int CALL24(___Socket______nativeConnect____I__AR_B_I, int ___fd___, int ___port___, struct ___Socket___ * ___this___, int ___fd___, struct ArrayObject * ___address___,int ___port___) {
#ifdef MULTICORE
// not supported in MULTICORE version
#endif
{
- int flag = 1;
- setsockopt(___fd___, IPPROTO_TCP, TCP_NODELAY, (char *) &flag, sizeof(flag));
+ int flag = 1;
+ setsockopt(___fd___, IPPROTO_TCP, TCP_NODELAY, (char *) &flag, sizeof(flag));
}
if (rc<0) goto error;
return -1;
#endif
}
+#endif
#ifdef TASK
-int CALL12(___Socket______nativeBindFD____I, int ___fd___, struct ___Socket___ * ___this___, int ___fd___) {
+#ifdef D___Socket______nativeBindFD____I
+void CALL12(___Socket______nativeBindFD____I, int ___fd___, struct ___Socket___ * ___this___, int ___fd___) {
#ifdef MULTICORE
#else
if (RuntimeHashcontainskey(fdtoobject, ___fd___))
RuntimeHashadd(fdtoobject, ___fd___, (int) VAR(___this___));
addreadfd(___fd___);
#endif
- return 0;
}
#endif
+#endif
-
+#ifdef D___Socket______nativeBind_____AR_B_I
int CALL12(___Socket______nativeBind_____AR_B_I, int ___port___, struct ArrayObject * ___address___, int ___port___) {
#ifdef MULTICORE
// not supported in MULTICORE version
#endif
#endif
}
+#endif
+#ifdef D___InetAddress______getHostByName_____AR_B
struct ArrayObject * CALL01(___InetAddress______getHostByName_____AR_B, struct ArrayObject * ___hostname___) {
#ifdef MULTICORE
// not supported in MULTICORE version
h=gethostbyname(str);
free(str);
- if (h != NULL) {
- for (n=0; h->h_addr_list[n]; n++) /* do nothing */ ;
+ if (h != NULL) {
+ for (n=0; h->h_addr_list[n]; n++) /* do nothing */;
#ifdef PRECISE_GC
- arraybytearray=allocate_newarray(___params___,BYTEARRAYARRAYTYPE,n);
+ arraybytearray=allocate_newarray(___params___,BYTEARRAYARRAYTYPE,n);
#else
- arraybytearray=allocate_newarray(BYTEARRAYARRAYTYPE,n);
+ arraybytearray=allocate_newarray(BYTEARRAYARRAYTYPE,n);
#endif
- for(i=0; i<n; i++) {
- struct ArrayObject *bytearray;
+ for(i=0; i<n; i++) {
+ struct ArrayObject *bytearray;
#ifdef PRECISE_GC
- {
- INTPTR ptrarray[]={1, (INTPTR) ___params___, (INTPTR)arraybytearray};
- bytearray=allocate_newarray(&ptrarray,BYTEARRAYTYPE,h->h_length);
- arraybytearray=(struct ArrayObject *) ptrarray[2];
- }
+ {
+ INTPTR ptrarray[]={1, (INTPTR) ___params___, (INTPTR)arraybytearray};
+ bytearray=allocate_newarray(&ptrarray,BYTEARRAYTYPE,h->h_length);
+ arraybytearray=(struct ArrayObject *) ptrarray[2];
+ }
#else
- bytearray=allocate_newarray(BYTEARRAYTYPE,h->h_length);
+ bytearray=allocate_newarray(BYTEARRAYTYPE,h->h_length);
#endif
- ((void **)&((&arraybytearray->___length___)[1]))[i]=bytearray;
- {
- int ha=ntohl(*(int *)h->h_addr_list[i]);
- (&bytearray->___length___)[1]=ha;
+ ((void **)&((&arraybytearray->___length___)[1]))[i]=bytearray;
+ {
+ int ha=ntohl(*(int *)h->h_addr_list[i]);
+ (&bytearray->___length___)[1]=ha;
+ }
}
- }
- return arraybytearray;
+ return arraybytearray;
+ } else {
+ return NULL;
+ }
#endif
- }
- else
- return NULL;
}
+#endif
-
+#ifdef D___ServerSocket______createSocket____I
int CALL12(___ServerSocket______createSocket____I, int port, struct ___ServerSocket___ * ___this___, int port) {
#ifdef MULTICORE
// not supported in MULTICORE version
return fd;
#endif
}
+#endif
+#ifdef D___ServerSocket______nativeaccept____L___Socket___
int CALL02(___ServerSocket______nativeaccept____L___Socket___,struct ___ServerSocket___ * ___this___, struct ___Socket___ * ___s___) {
#ifdef MULTICORE
// not supported in MULTICORE version
return newfd;
#endif
}
+#endif
+#ifdef D___Socket______nativeWrite_____AR_B_I_I
void CALL24(___Socket______nativeWrite_____AR_B_I_I, int offset, int length, struct ___Socket___ * ___this___, struct ArrayObject * ___b___, int offset, int length) {
#ifdef MULTICORE
#else
while(length>0) {
bytewritten=write(fd, &charstr[offset], length);
if (bytewritten==-1&&errno!=EAGAIN)
- break;
+ break;
length-=bytewritten;
offset+=bytewritten;
}
}
#endif
}
+#endif
+
+#ifdef D___Socket______nativeRead_____AR_B
int CALL02(___Socket______nativeRead_____AR_B, struct ___Socket___ * ___this___, struct ArrayObject * ___b___) {
#ifdef MULTICORE
return -1;
return byteread;
#endif
}
+#endif
+#ifdef D___Socket______nativeClose____
void CALL01(___Socket______nativeClose____, struct ___Socket___ * ___this___) {
#ifdef MULTICORE
#else
close(fd);
#endif
}
+#endif