|
|
|
|
@ -1,7 +1,11 @@
|
|
|
|
|
/*
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "UDPTCPNetwork.h"
|
|
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <fcntl.h>
|
|
|
|
|
#include <unistd.h> /* close() */
|
|
|
|
|
#include <string.h> /* memset() */
|
|
|
|
|
|
|
|
|
|
@ -39,7 +43,7 @@ int dns_filladdr (string host, string port, int ai_family, struct sockaddr_stora
|
|
|
|
|
char* itoa(char* buffer, int number, int size) {
|
|
|
|
|
snprintf (buffer, size, "%d", number);
|
|
|
|
|
return buffer;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UDPTCPNetwork_Startup() {
|
|
|
|
|
@ -65,4 +69,16 @@ void UDPTCPNetwork_Startup() {
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
UDPTCPNetwork_init = 1;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int file_is_readable (const char *fname) {
|
|
|
|
|
int f;
|
|
|
|
|
|
|
|
|
|
if ((f = open(fname, O_RDONLY)) == -1) return 0;
|
|
|
|
|
close (f);
|
|
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|