<commit_before>#include <arpa/inet.h>
#include <sys/socket.h>

int main()
{
	struct sockaddr_in addr;
	int sock;

	memset(&addr, 0, sizeof addr);

	// TODO: addr.sin_addr

	addr.sin_port   = htons(5678);
	addr.sin_family = AF_INET;

	sock = socket(PF_INET, SOCK_STREAM, 0);
	if(sock == -1)
		return 1;

	switch(connect(sock, (struct sockaddr *)&addr, sizeof addr)){
		case -1:
			perror("connect()");
			break;
		case 0:
			printf("connected :)\n");
			break;
		default:
			printf("buf?\n");
	}

	close(sock);

	return 0;
}<commit_msg>Added manual mode for testing and because I was bored<commit_after>#include <sys/socket.h>
#include <errno.h>

#ifdef MANUAL
struct sockaddr_in
{
	int _in_stuff;             /* 8 bytes */
	unsigned char sin_zero[8]; /* 16 - sizeof above members */
};

#  include <syscalls.h>
#  define socket( a, b, c) __syscall(SYS_socket,  a, b, c)
#  define connect(a, b, c) __syscall(SYS_connect, a, b, c)

#else
#  include <arpa/inet.h>
#endif

int htons(int x)
{
	// TODO
}

int main()
{
	struct sockaddr_in addr;
	int sock;

#ifdef MANUAL
	addr._in_stuff = 0;

	addr._in_stuff |= AF_INET     << 14; /* BUH - fix */
	addr._in_stuff |= htons(5678) << 12;
	/* 0.0.0.0 */

#else
	addr.sin_port   = htons(5678);
	addr.sin_family = AF_INET;
#endif

	sock = socket(PF_INET, SOCK_STREAM, 0);
	if(sock == -1){
		perror("socket()");
		return 1;
	}

	switch(connect(sock, &addr, sizeof addr)){
		default: /* FIXME: signed cmp, i think */
		case -1:
			printf("errno %d\n", errno);
			/*perror("connect()");*/
			printf("connect(): %s\n", strerror(errno));
			break;
		case 0:
			printf("connected :)\n");
			break;
	}

	close(sock);

	return 0;
}
{'fraction_non_alphanumeric': 0.17519566526189043, 'fraction_numerical': 0.022877784467188442, 'mean_word_length': 3.350785340314136, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7514290', 'n_tokens_mistral': 746, 'n_tokens_neox': 668, 'n_words': 167}